# Find arc center from tangent lines and 'rounding value'

Simple and common question: I want to round two intersecting lines with arc, so I need to know its center point.

I have defined:

• AP - first line
• BP - second line
• |PR| - rounding scalar value, so the arc stars on R point

How to find C - center point of arc?

-
What exactly are you given and want do you want to find? $\vec{AP}$, $\vec{BP}$, $|PR|$ to find $\vec{RC}$? If you want to find coordinates of $C$, you must have coordinates of some other point. –  Karolis Juodelė Sep 6 '12 at 14:35
I understand you question as: you have two intersecting lines and $R$ is a point where arc tangent one of them. And you want to find center of this arc? Center is intersection of bisector $\angle P$ and perpendicular to $PB$ at point $R$ So you need to know something about Tan$\angle P$. –  Mike Sep 6 '12 at 15:15
Karolis Juodelė, I have also |PR| value, so I can find R point. –  brigadir Sep 6 '12 at 15:22
Mike, thanks. I also have an idea how to solve it, by intersecting perpendicular of PR and PQ (Q is the same as R but on PA line). But this case is widely common, so I want to find ready canonic solution. This is in context of PC program, so needs most optimized solution. –  brigadir Sep 6 '12 at 15:27
If you have coordinates of all points, A,P,B,R then optimized solution is in Karolis Juodelė answer. –  Mike Sep 6 '12 at 15:35
If you gave vectors, notice that $\vec{CR} \cdot \vec{PB} = \vec{CQ} \cdot \vec{PA} = 0$ where $Q = P + \frac{|PR|}{|PB|}\vec{PA}$.
Thanks, works fine! If anyone will be interested, here is code of calculating arc center (L and N are tangent points): C.y = (L.y * (L.y-P.y)/(L.x-P.x) + L.x - N.y * (N.y-P.y)/(N.x-P.x) - N.x) / ((L.y-P.y)/(L.x-P.x) - (N.y-P.y)/(N.x-P.x)); C.x = (C.y-L.y) * (L.y-P.y) / (L.x-P.x) + L.x; –  brigadir Sep 11 '12 at 7:41