processing-docs icon indicating copy to clipboard operation
processing-docs copied to clipboard

The explanation of the `scale` example is misleading.

Open soegaard opened this issue 4 years ago • 0 comments

Issue description

The manual has a series of examples of transformations. One of them is the scale example. It contains the following comment:

Paramenters for the scale() function are values specified as decimal percentages. For example, the method call scale(2.0) will increase the dimension of the shape by 200 percent. Objects always scale from the origin.

There are a few confusing issues here:

  • If the input of scale() were percentages, the call to double the size would be scale(200).
  • The increase of dimension for the call scale(2.0) is not 200% but only 100%. The problems is that 2.0 is the growth factor and the growth rate is growth_rate = growth_factor - 1
  • The call to scale doesn't scale the size on an object - it changes how coordinates are interpreted.

The actual example is a fine illustration of the use of scale() so I am only suggesting changing the explanation.

URL(s) of affected page(s)

https://github.com/processing/processing-docs/blob/master/content/examples/Basics/Transform/Scale/Scale.pde

Proposed fix

soegaard avatar Jul 01 '21 09:07 soegaard