Kuzminski, Stefan R wrote:
> Hi,
>
> If I rotate a shape, I seem to get an odd axis value after the rotation=
..
>
> here is a simple program=85
>
> from visual import *
>
> shape =3D cylinder( pos=3D( 0, 0, 0 ),
>
> length=3D.1,
>
> radius=3D.01 )
>
> print =91before=92, shape.axis
>
> shape.rotate( angle=3Dpi/2, axis=3D(0,0,1))
>
> print =91after=92, shape.axis
>
> and here is the output.. shouldn=92t =91after=92 be [0, 0.1, 0] am I mi=
ssing=20
> something?
>
> C:\>python tmp.py
>
> Visual-2003-10-05
>
> before [0.1 0 0]
>
> after [6.12303e-018 0.1 0] =DF ???
>
> thanks,
>
> Stefan
>
The algorithms for generalized rotation unavoidably introduce a tiny=20
error (this example shows an error 18 orders of magnitude smaller than=20
the value!). Keep in mind that since pi cannot be represented exactly in=20
a computer, neither is pi/2 nor is rotating by pi/2.
HTH,
Jonathan Brandmeyer
|