0
$\begingroup$

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

enter image description here

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?

  • 0
    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.2012-09-06
  • 0
    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$.2012-09-06
  • 0
    Karolis Juodelė, I have also |PR| value, so I can find R point.2012-09-06
  • 0
    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.2012-09-06
  • 0
    If you have coordinates of all points, A,P,B,R then optimized solution is in Karolis Juodelė answer.2012-09-06

1 Answers 1

0

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}$.

  • 0
    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;`2012-09-11