How do you calculate the end point coordinates for an arc given the center coordinates, radius and sweep angle?
I am working in PHP with some filled arcs and I am having a hard time finding a way to calculate the coordinates for the end point of the arc. I know the coordinates of the center point, radius (width and height are the same), start angle and end angle (as required by php's imagefileldarc () function). From this, how can I calculate the coordinates of the end point 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
+3
source to share