so I need the parametric equation of the arc. So, arc is a sector of a circle.
Parametric circle equation is: $$ c \equiv f(t) = (\cos(t), \sin(t)),\quad 0\le t < 2\pi $$ So, we just need to find proper domain of the function, actually $t_1$ and $t_2$, start and end of a sector.
Given two points $P_1$ and $P_2$, liying on circle, its center and radius how to find $t_1$ and $t_2$ using given points? I need full parametric equation of this.
Thanks in advance!
$\endgroup$ 43 Answers
$\begingroup$Given the two endpoints $P$ and $Q$, the center $C$, and the radius $r$, then $$ s=2\arctan\left(\frac{P_y-C_y}{P_x-C_x+r}\right) $$ $$ t=2\arctan\left(\frac{Q_y-C_y}{Q_x-C_x+r}\right) $$ The equation would be $$ C+r(\cos(\theta),\sin(\theta)) $$ for $\theta$ between $s$ and $t$.
Beware that there are two circular arcs with center $C$ connecting the points $P$ and $Q$. If $s\lt t$, then the arc is counter-clockwise from $P$ to $Q$. If $s\gt t$, then the arc is counter-clockwise from $Q$ to $P$. If the $s$ and $t$ given above produce the wrong arc, just add $2\pi$ to the smaller one.
Given $P$, $Q$, and $r$ we can find two possibilities for $C$. First we need to define the linear map $$ T(x,y)=(-y,x) $$ which rotates by $\pi/2$ counter-clockwise. Then we get the formula $$ C=\frac{P+Q}2\pm T(P-Q)\sqrt{\left(\frac{r}{|P-Q|}\right)^2-\frac14} $$
$\endgroup$ 4 $\begingroup$The equation in OP is the parametric equation of a circle with center in the origin of the coordinates and radius $r=1$.
The parametric equation of a circle of radius $r$ and center $C\equiv (a,b)$ is : $$ f(t)=(a+r\cos t, b+r \sin t) , \quad 0\le t <2\pi $$ If you know $P_1\equiv (a+r\cos \theta_1, b+r \sin \theta_1) $ and $P_2\equiv (a+r\cos \theta_2, b+r \sin \theta_2) $ then the equation of the arc is simply $$ f(t)=(a+r\cos t, b+r \sin t) , \quad \theta_1\le t \le\theta_2 $$
If you know the coordinate of the points, e.g.$ P_1 \equiv(x_1,y_1) $, you can find $\theta_1$ noting that: $$ \cos \theta_1=\dfrac{x_1-b}{\sqrt{(x_1-a)^2+(y_1-b)^2}} $$ and
$$ \sin \theta_1=\dfrac{y_1-b}{\sqrt{(x_1-a)^2+(y_1-b)^2}} $$
$\endgroup$ 1 $\begingroup$Late answer, but I think I can add something useful to the discussion. When radius is given, you have to choose between 2 possible centers and then between 2 possible arcs. Instead, given the oriented angle $\theta$ (counterclockwise if positive or clockwise if negative), there is only one possible arc going from point $P_1=[x_1,y_1]$ to point $P_2=[x_2,y_2]$. In such case you don't have to choose anything, and you can obtain center $C$ and radius $r$ from the following expression (I used Maxima to obtain them):
$$\mathit{c_x}=\frac{\left(1+ \cos{(\theta)}\right) \, \left( \mathit{y_1}-\mathit{y_2}\right) +\sin{(\theta)} \left( \mathit{x_1}+\mathit{x_2}\right) }{2 \sin{(\theta)}}$$
$${c_y}=\frac{\sin{\left( \theta \right) \left( {y_1}+{y_2}\right)}+\left( 1+\cos{\left( \theta \right) }\right)\left( {x_2}-{x_1}\right) }{2 \sin{\left( \theta \right) }}$$
$$r=\sqrt\frac{{{\left( \mathit{x_2}-\mathit{x_1}\right) }^{2}}+{{\left( \mathit{y_2}-\mathit{y_1}\right) }^{2}}}{2 \left( 1-\cos{(\theta)}\right) }$$
$\endgroup$