# Need Some Help

## Recommended Posts

Ok lets say I have an object with the position: x: 3 & y: 5. I want to move the object with 5 pixels with an angle of 30 degrees. How would I calculate the new position? Im giving alot of thought in this, but I can't figure it out. Hope I made myself clear. Thanks Vytas.

##### Share on other sites

That's trigonometry. Look up sines, cosines, and tangents. I still remember "SohCahToa" from my high school trig classes. If you know the angle and the distance, you can calculate the X and Y needed.Soh: sine(angle) = opposite/hypotenuseCah: cosine(angle) = adjacent/hypotenuseToa: tangent(angle) = opposite/adjacentSo the sine of 30 degrees is the same as the opposite leg (Y value) divided by the hypotenuse. If you know the hypotenuse is 5 and the value of the sine of 30 degrees, then you can figure out the one missing value. e.g.:sin(30) = Y/5Y = 5 * sin(30)cos(30) = X/5X = 5 * cos(30)Just make sure you don't confuse degrees and radians.http://en.wikipedia.org/wiki/Hypotenuse

##### Share on other sites

Thank you so much for that information, I knew it had something to do with the SIN, COS or TAN but I just didn't know how to make it work.

##### Share on other sites

• 2 weeks later...

Hmm, I never actually completely understood the difference between radians and degrees, but I also didn't know what radians were in the first place... I know degrees devide a circle into 360 cakeslices, but would that make radians something like the amount of thumbs around a wheeltire?Lol. ##### Share on other sites

There are 2pi radians in a circle, an arc with an angle of 1 radian gives a curve that is the same length as the radius.http://en.wikipedia.org/wiki/Radians

##### Share on other sites

180° = πrEdit: whoops, JSG got there first, while I was trying to find the pi character in the character map!

Edited by Synook
##### Share on other sites

Ah, that clears up a bit. So basically, a radian is somewhat like 58 degrees, based on a different measurement.