Returns the positive
real
value of smallest magnitude \epsilon which an element of aTransform
should contain. An element of aTransform
may also contain -\epsilon.The value \epsilon is used for in the function
clean()
(see Transform Reference; Cleaning). It will also be used for comparingTransforms
, when I've added the equality operatorTransform::operator==()
.
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 transform two differentTransforms
t_1 and t_2 using different rotations in such a way that the end result should be the same for bothTransforms
. Let \epsilon stand for the value returned byepsilon()
. If for all sets of corresponding elements E_1 and E_2 of t_1 and t_2, ||E_1| - |E_2|| \le \epsilon, then \epsilon is a good value. It will be easier to test this when I've addedTransform::operator==()
.Rotation causes a significant loss of precision to due to the use of the
sin()
andcos()
functions. Therefore, neitherTransform::epsilon()
norPoint::epsilon()
(see Point 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
.