Based on the user's location I want to draw a circle that passes a given coordinate X (so the radius will be the distance from the user location to X).
Based on this https://smilebasicsource.com/forum?fpid=7022
I managed to get a solution that works, but when I check the points I get a ellipse and not a circle.
Can anyone tell me why?
//The following code rotates with 1 degree each time its run. after 360 times I get the circle (ellipse) below.
var R = 0.0174533; //1 degree
var X = World.obj.locations[0].longitude;
var Y = World.obj.locations[0].latitude;
var CX = World.userLocation.lon;
var CY = World.userLocation.lat;
var C = Math.cos(R);
var S = Math.sin(R);
var DX = X - CX;
var DY = Y - CY;
var NX = CX+DX*C-DY*S;
var NY = CY+DX*S+DY*C;
World.obj.locations[0].latitude = NY;
World.obj.locations[0].longitude = NX;
