| Topic: In the example rotation ...
|
|
 | In the example rotation ... | |  |
| Poster | : lintford | | Posts | : 7 | | Country | : England | | City | : Manchester |
| | | | Posted by lintford on 28/05/2008 at 07:23:03
| | Hi Riemer,
Great tutorials, but I have a question about the rotation example that you provided.
You say we are to rotate the coordinates around the Z axis by 45 degrees.
But i don't understand in the matrix diagrams, how you go from :
cos(pi / 4) = 2 squared over 2
and
cos(pi / 4) = 2 squared over 2.
how do you get the 2 squared over 2 bit?
I would really appreciated it if you could provide some more information about this.
Thanks for your help and the tuts.
Adios | |
|
| | | | | | Poster | : riemer | | Posts | : 1392 | | Country | : Belgium | | City | : Antwerp |
| | | | Posted by riemer on 28/05/2008 at 15:53:27
| | Good question!
And luckily, the answer is quite simple. A sine (and a cosine) is just a number, always between -1 and 1. (You probably know Pi is also a number, 3.14)
so find a nice calculating maching, and type in "cos(pi/4)". Or just go to www.google.com, and type this in in the search field. You will get 0.707106781 as answer.
Now type in sqrt(2)/2. You will get the same number. I probably just have to omit the second step in the equation, and go immediately from cos(pi/4) to 0.7071.
Does this make any sense? | |
|
| | | | | | Poster | : Lintford | | Posts | : 7 | | Country | : England | | City | : Manchester |
| | | | Posted by Lintford on 29/05/2008 at 05:03:12
| | Hi Riemer,
Thanks for the reply.
Yes, it does make sense (in that cos(pi/4) equals 0.7071 ).
but, if we took a different number, (not 45°) as the rotation degree, how would you work out the middle equation, obviously it wouldn't still be 2 squared over 2, did you just know this from expierence, or did you work it out some how? I still don't see any relationship between the two equations :s
Also, I made a mistake in my OP, I meant to ask, how or why is it that cos(pi/4) and sin(pi/4) both have the same values (0.7071); are they not different calculations - or is it just because theta is 45°? (did I use "theta" correctly :)
Thanks
Bye | |
|
| | | | | | Poster | : riemer | | Posts | : 1392 | | Country | : Belgium | | City | : Antwerp |
| | | | Posted by riemer on 29/05/2008 at 13:42:46
| | You're correct, it's a bad example. 45 degrees is the point where the sine and cosine have the same value (just like 45+180 degrees). That's why the result is known to be sqrt(2)/2.
More general, if you want to find the sine of angle x, do this:
sin(pi/180*x)
since Pi radians corresponds to 180 degrees. So in case of 20 degrees, you would get a sine value of 0.342 and a cosine value of 0.939.
And yes, you did use theta correctly ;)
If you have any suggestions on how I should update the chapter, let me know! | |
|
|
 | | |  |
|
|
|
If you appreciate the amount of time I spend creating and updating these pages, feel free to donate -- any amount is welcome !
|
- Website design & DirectX code : Riemer Grootjans - ©2006 Riemer Grootjans
|
|