im trying to draw an arc in OpenLayers, in non Geo map it works well and here is my code:
function calculateArcPointsNonGeo(center, radius,startAngle,endAngle,segments)
{
var pointList = [],
Angle,
x,
y,
point,
i;
var dAngle = segments + 1;
for (i = 0; i < dAngle; i++) {
Angle = startAngle - (startAngle - endAngle) * i / (dAngle - 1);
x = center.X + radius * Math.cos(Angle * Math.PI / 180);
y = center.Y + radius * Math.sin(Angle * Math.PI / 180);
point = new MapPoint(x,y);
pointList.push(point);
}
return pointList;
}
in addition there is a great Example that demonstrates it , but when im trying to do this on Geo map (WGS84 coordinate system) its start to acting weird, i assume that i need to convert degrees to radinas or something like this. please help