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
    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

1

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