I’m working in PHP with some filled arcs and I’m having trouble finding a way of calculating the coordinates for the end point of an arc. I know the centre point coordinates, the radius (the width and height are the same), the start angle, and the end angle (as is required by the php imagefileldarc() function). From this, how can I calculate the end point coordinates for the arc?
I’ve tried the following formula to no avail:
$end['x'] = cos($Angle) * $Radius + $CenterX;
$end['y'] = sin($Angle) * $Radius + $CenterY;
Many thanks
The fact that you are drawing an arc does not really matter. Your calculation will always be:
x=cos(angle)*radius + centerx
y=sin(angle)*radius + centery