Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Formula of a circle
Message
De
01/11/2007 15:41:25
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01265824
Message ID:
01265854
Vues:
13
This message has been marked as a message which has helped 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

That looks quite tricky. Let me see if I can at least get started.

The general equation for a circle, IIRC, is (x-a)^2 + (y-b)^2 = r^2, where (a,b) is the center of the circle, and r is the radius. Of course, you don't know any of these three pieces of data for a start.

If you want to specify a circle with points, you normally would need three points, not all on the same line. Pressumably, you would have to solve the simultaneous equations.

With two lines, and the tangency points, I think you have sufficient information to specify the circle. But specifying ONLY the two points would not be enough. Evidently, any point lying on the circle would pass through a tangent line.

If you have two tangency lines, and the points of tangency, you can draw the normal (i.e. perpendicular) line for each, and see where they intersect. That would give you the center of the circle. For the radius, just get the distince of the center thus found, to any of the tangency points.

If you have the equation of a tangency line, to draw a perpendicular line, you should consider the following: for two perpendicular lines, the product of their slopes is -1 (minus 1). Thus, if one line has a slope of 2, the perpendicular thereof has a slope of -1/2.

Well, I guess that "basically" solves the problem; you will have to do some manipulation with equations for lines. As you may remember, a line can be expressed in several ways, one of them is y = ax + b, where a is the slope and b is the y-intersect.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform