Matrix rotation by 90 degree about Y.

Started by
2 comments, last by Ebola0001 17 years, 8 months ago
Hi, I have a weird (for me) problem, i am trying to transform vector (1,0,0) using a matrix that was rotated 90 degree (which was converted to randians) at the Y axis, supostly the resulted vector should be (0,0,-1) but i am geting (2.6301,0,-1), When i try to rotate the same vector by 90.1 or 89.9 degree then i get correct transformation, something like (-0.001, 0, -0.099999), but with exact 90 degree i am getting too much difference. -------------------------------- Im am converting 90 degree to radians using pi/180 = 0.017453 then i do 90*0.017453 = 1.57077 radians; in my matrix rotation procedure i am calculating matrix_11 = cosine(1.57077) = 2.6301 which is X value that later i will get in my vector transformation when i do: new_x:=(x*matrix._11)+(y*matrix._21)+(z*matrix._31)+(matrix._41); The weird thing is that i have tryed in excel the follow formula values: cos(1.5703)=0.0004 cos(1.5704)=0.0003 cos(1.5705)=0.0002 cos(1.5706)=0.0001 cos(1.5707)=9.6327 (!!) //this is 90 degree, cos(1.5708)=-3.067E (!!)//this is 90.001 degree, cos(1.5709)=0.0001 So am i wrong thinking vector (1,0,0) rotated 90 deg at Y is (0,0,-1)? thanks
Advertisement
Quote:supostly the resulted vector should be (0,0,-1) but i am geting (2.6301,0,-1)
Can you post the exact output of the program? It looks like you may be misreading numbers expressed in scientific notation.
The numbers you're getting from Excel are clipped off. What is really there is some value followed by an 'E', then a negative number. These expressions represent numbers that are actually very close to zero: [google] "scientific notation".

Depending on how exactly you're investigating the supposedly erroneous numbers in your code, it may be the same thing there.
in answer to the question of the full excel output (from my excel)

=cos(1.5707) = 9.63268E-05 = .0000963268
=cos(1.5708) = -3.67321E-06 = -.00000367321

=cos(1.5703) 0.000496327
=cos(1.5704) 0.000396327
=cos(1.5705) 0.000296327
=cos(1.5706) 0.000196327
=cos(1.5707) 9.63268E-05
=cos(1.5708) -3.67321E-06
=cos(1.5709) -0.000103673

to his specific value of 1.57077

=cos(1.57077) = 2.63268E-05 = .0000263268
Quando Omni Flunkus MoritatiWhen All Else Fails, Play Dead!

This topic is closed to new replies.

Advertisement