I have a line that goes to x (x1) of 300, and then I rotate the line by -10 degrees. How can I get the new x (x0) of the rotated line?
Here's a picture to show what I mean:

Are there any books that would help me learn this stuff?
|
|
you can easily use a rotation matrix of -10deg to find your answer. check wikipage to learn how to create a rotation matrix. after that you only need to multiply rotation matrix into (300,0). If I'm not mistaken for your problem you also need height of rectangle to find intersection point; here is a sudo code that computes x1 for you:
|
|||
|
You should learn trigonometry on Khan Academy. We didn't yet learn it in the school, but I believe it has to do something with sines and cosines and tangents. The basic idea is that when you do a thing like that, you get a right triangle, where the hypotenuse is the line from your standpoint to x1. If you do sin(a), you would get the length of your desired line divided by the hypotenuse, I'm not sure I never really got into this and no one thought me, so this might be false. Check on the internet (although it's obvious that you get a right triangle and need to use trigonometry). |
|||
|
|
If it is not on the line (which means the new line is not longer, just rotated), the x position is Length * sin (angle) and the y position is Length * cos(angle).
You must yourself switch the 52 to -52 as the sinus function doesn't do that. So the answer should be (-52 , 295). |
|||||||
|