I would like to know how to get a specific point on the circumference of a circle, given an angle. The diameter of the circle is 1, and the center point of the circle is { X: 0.5, Y: 0.5 }.
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
|
|
You can work this out using basic trigonometry. http://www.freehomeworkmathhelp.com/Trigonometry/Trigonometry_Introduction/trigonometry.html
I always remember the above as
The above means if we have the angle and one length of a right-angled triangle we can work out the lengths of the other sides. Luckly your problem can be thought of as calculating the length of triangle sides:
Above, r is the hypotenuse, x is the adjacent and y is the opposite. So for x:
And for y:
This is assuming a circle at (0, 0), so we just add on the circle's center.
Note: The C# Math functions use angles in radians, so if you have degrees convert them first:
|
|||||||||||||||
|
