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

How to draw an arc, I have these values

x  // x coordinate 
y // y coordinate 
r // Arc radius
startAngle // Starting point on circle
endAngle // End point on circle
clockwise  // clockwise or anticlockwise

where x,y is the center of circle. Can someone please provide me equation for drawing an arc?

share|cite|improve this question
What do you mean by "draw"? Are you using some kind of software? x,y are coordinates of what? – yohBS Jan 2 '12 at 17:16
I have to draw an arc using my own method in programming language like javascript. x,y is the center of circle. – coure2011 Jan 2 '12 at 17:29

$x(t) = x_0 + r \cos(t)$, $y(t) = y_0 + r \sin(t)$, for $t\in[\text{startAngle},\text{endAngle}]$.

share|cite|improve this answer

My 9 year old daughter thinks that this is the best way to draw an arck.

enter image description here

share|cite|improve this answer

You have everything it takes to draw an arc. The equation of circle is

$(X-x_1)^2+(Y-y_1)^2=r^2$ where $(x_1,y_1)$ is the centre of circle and $r$ is its radius. You also have the angle of arc, say $\theta$. You can either vary the parameter $t$ as told by lhf or you can find the $x$ and $y$ co-ordinates of start and end points of the arc from simple trigonometric relations as follows.

Let $(x_2,y_2)$ and $(x_3,y_3)$ be start and end points of arc respectively. You can find values of $x_2, x_3$ and $y_2,y_3$ from the fact that

$tan(\theta_1)=\frac{y_2-y_1}{x_2-x_1}$ where $\theta_1$ is the start angle. Plus, the value of $(x_1-x_2)^2+(y_1-y_2)^2=r^2$ is known, so from these two equations, you can find the value of $(x_2,y_2)$. Ditto for $(x_3,y_3)$ and you are done.

So, you have the equation of arc as:

$(X-x_1)^2+(Y-y_1)^2=r^2$ where $X \epsilon [x_2,x_3]$ & $Y \epsilon [y_2, y_3]$. (whichever is greater between $x_2,x_3$ or $y_2,y_3$, take the interval accordingly.)

share|cite|improve this answer

If you are using Mathematica, Graphics[Circle[{x, y}, r, {startAngle, endAngle}]] does that. It is always anticlockwise, so for clockwise, swap the start and end angles.

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.