I am trying to find the X, Y points on a circle where 0 degrees starts at the top of the circle and moves clockwise. Typically, to find the x, y coordinates on a circle with a known radius and angle you could simply use the formula x = r(cos(degrees°)), y = r(sin(degrees°)). The circle would look like this and the degrees would expand counterclockwise from 0°.
However, I am using a circle where the 0° starts at the top and the degrees expand as one moves clockwise around the circle. Supposing that var r = 60;
and var degrees = 130;
what formula could I use (or javascript methods) to determine the X, Y values. Note: I can assume an origin point of 0, 60 because r = 60. Thanks.
Typically, to find the x, y coordinates on a circle with a known radius and angle you could simply use the formula x = r(cos(degrees°)), y = r(sin(degrees°)).
As full circle has 2 radiants so you could calculate point coordinates for your circle with following formula:
x = radius * Math.sin(Math.PI * 2 * angle / 360);
y = radius * Math.cos(Math.PI * 2 * angle / 360);
var radius = 60;
var angle = 140;
var x = radius * Math.sin(Math.PI * 2 * angle / 360);
var y = radius * Math.cos(Math.PI * 2 * angle / 360);
console.log('Points coors are x='+
Math.round(x * 100) / 100 +', y=' +
Math.round(y * 100) / 100)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With