Environment versions
Network:
Windows 2003 Server
>I am trying to smooth some intersecting lines, and for that I think I need the formula of a circle that is tangent to this two intersecting lines; now, I realize that there will be infinite circles matching this, but I can or would like to <g> specify the tangent points (the points where the circle touches each line), but I am googling for this formula without much success, and all the links that look promising get blocked by the internet filter, so, does anyone know how can I solve this problem?
>
>
>TIA
>
>Hugo
Let as assume you know tangent lines and coordinates of tangent points on them:
y=ax+b, (e,f)
y=cx+d, (g,h)
Then you draw the perpendicular lines
y = -x/a + f + e/a
y = -x/c + h + g/c
Center of the circle is on the intersection of those two perpendicular lines. Its coordinates are:
Cx = (h + g/c - f - e/a)* c* c/(a-c)
Cy = -(Cx)/a + f + e/a
Radius is:
R= sqrt((Cx-e)^2 + (Cy - f)^2)
And formula for circle is:
(y-Cy)^2 + (x - Cx)^2 = R^2
Good Luck
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only