Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Formula of a circle
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01265824
Message ID:
01265864
Views:
9
This message has been marked as the solution to the initial question of the thread.
>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
Map
View

Click here to load this message in the networking platform