Planar logo

Previous topic

Polygon Objects

Next topic

planar.Vec2 – 2D Vectors

This Page

planar – Global Definitions

planar.__versioninfo__

Package version as a tuple of three integers: (major_version, minor_version, bugfix_version).

planar.__version__

Package version as a string: "major_version.minor_version.bugfix_version".

planar.EPSILON

Allowed absolute error value for approximate floating point comparison operations.

planar.EPSILON2

Squared absolute error value, always EPSILON**2.

planar.set_epsilon(epsilon)

Set the global absolute error value and rounding limit for approximate floating point comparison operations. This value is accessible via the planar.EPSILON global variable.

The default value of 0.00001 is suitable for values that are in the “countable range”. You may need a larger epsilon when using large absolute values, and a smaller value for very small values close to zero. Otherwise approximate comparison operations will not behave as expected.

Warning

You should only change the EPSILON value via the set_epsilon() function. Assigning a value to the variable directly will not work correctly, and may result in undefined behavior.