#### Archived

This topic is now archived and is closed to further replies.

# Vector : a trigonometric problem

This topic is 5924 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I''d like to calcul the traject for my bullet but I''ve a trigonometric problem and it''s so far for me, about 4 years ... Here''s my example : img src="http://ibelgique.ifrance.com/Slug-Production/Images/Vector.jpg"> I''ve a vector who begins at X, Y ==> (0,0) His length is : 10 On the example, if the angle is equal to 0°, the vector''s direction will be X,Y ==> (0,10). But my question is, where will be the vector if the angle equals 30° ??? So, I must consider this : - The angle - The lenght of my vector What''s the formul for calculating this ? It''s possible to apply this formule with a example. I''m gonna take this example. 1) - The anle = 0° - The vector''s lenght = 10 2) - The angle = 90° - The vector''s lenght = 10 ==> In this case, X will be equal to - 10 and Y to 0 ======================== Leyder Dylan http://ibelgique.ifrance.com/Slug-Production/

##### Share on other sites
Oups, I''ve made a mistake :

========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/

##### Share on other sites
X = cos(30) * 10;
Y = sin(30) * 10;

but remember that that the default c/c++ math lib works with radians and not degrees as opengl does. so you first have to transform you degree values to radians... you can do that by multiplying the degree by (PI/180)

//ziruz

------------------------------------------------------------
XL is comming soon @ http://ziruz.cjb.net/

##### Share on other sites
Thanks a lot, I''m gonna use this.

========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/

1. 1
2. 2
3. 3
4. 4
5. 5
Rutin
15

• 14
• 9
• 9
• 9
• 10
• ### Forum Statistics

• Total Topics
632912
• Total Posts
3009199
• ### Who's Online (See full list)

There are no registered users currently online

×