Returns the positive
real
value of smallest magnitude \epsilon that should be used as a coordinate value in aPoint
. A coordinate of aPoint
may also contain -\epsilon.The value \epsilon is used for testing the equality of
Points
inPoint::operator==()
(see Point Reference; Operators):Let \epsilon be the value returned by
epsilon()
, P and Q bePoints
, and P_x, Q_x, P_y, Q_y, P_z, and Q_z the updated x, y, and z-coordinates of P and Q, respectively. If and only if ||P_x| - |Q_x|| < \epsilon, ||P_y| - |Q_y|| < \epsilon, and ||P_z| - |Q_z|| < \epsilon, then P = Q.
epsilon()
returns different values, depending on whetherreal
isfloat
ordouble
: Ifreal
isfloat
(the default),epsilon()
returns 0.00001. Ifreal
isdouble
, it returns 0.000000001.Please note: I haven't tested whether 0.000000001 is a good value yet, so users should be aware of this if they set
real
todouble
!1 The way to test this is to start with twoPoints
P and Q at different locations. Then they should be transformed using different rotations in such a way that they should end up at the same location. Let \epsilon stand for the value returned byepsilon()
, and let x, y, and y stand for theworld_coordinates
of thePoints
afterapply_transform()
has been called on them. If x_P = x_Q, y_P = y_Q, and z_P = z_Q, \epsilon is a good value.Rotation causes a significant loss of precision to due to the use of the
sin()
andcos()
functions. Therefore, neitherPoint::epsilon()
norTransform::epsilon()
(see Tranform Reference; Returning Information) can be as small as I'd like them to be. If they are two small, operations that test for equality ofTransforms
andPoints
will returnfalse
for objects that should be equal.
[1] For that matter, I haven't really tested whether 0.00001 is a
good value when real
is float
.