Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm defining an arc by calling a function like this: arc(x, y, radius*2, radius*2, start, end);

x: center x.
y: center y.
radius*2: width.
radius*2: height.
start: start angle in radians or degrees.
end: end angle in radians or degrees.

And now I need to "close" the arc by drawing two lines, both from the center of the arc, to the start and end point of the arc.

How do I find the start and end points?

share|cite|improve this question
You know the parametric equations for a circle? – J. M. Aug 20 '12 at 13:51
No I don't think so. – 01AutoMonkey Aug 20 '12 at 14:01
Well... you have some reading to do then!. If you get stuck come back with your sticking point. – rschwieb Aug 20 '12 at 14:27
If you have different values for width and height, you have an ellipse, not a circle. Why is radius*2 repeated in the argument list? – Ross Millikan Aug 20 '12 at 14:33
Are you working in GeoGebra? – Sigur Aug 20 '12 at 14:45

After reading as suggested by @rschwieb I came up with the following:

s_x = x+radius*Math.cos(startAngle*Math.PI);
s_y = y+radius*Math.sin(startAngle*Math.PI);
e_x = x+radius*Math.cos(endAngle*Math.PI);
e_y = y+radius*Math.sin(endAngle*Math.PI);
share|cite|improve this answer
If your angles are in radians, you do not need the Math.PI factor. If your angles are in degrees, then you will need a factor of Math.PI/180 instead. – robjohn Aug 22 '12 at 19:16

Given start angles and end angles you get

sX = offsetX + radius * cos(startAngle * PI/180)
sY = offsetY + radius * sin(startAngle * PI/180)
eX = offsetX + radius * cos(endAngle * PI/180)
eY = offsetY + radius * sin(endAngle * PI/180)

Multiplying an angle by PI/180 converts degrees to radians.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.