roseanna Posted March 31, 2010 Posted March 31, 2010 I have an application that creates a circle then a line based on inputs from a database. In real-time mode, I can easily create a tangent line from the endpoint of the line to the circle. How can I do this in VBA? thanks Quote
gile Posted March 31, 2010 Posted March 31, 2010 Hi, The easiest way should be invoking the LINE command with TAN osnap via SendCommand. To avoid using SendCommand you can use a geometric method: The tangent points from a point to a circle are the intersection points betwenn the circle and another one wich center is the middle of the line between the circle center and the point and which radius is the half of this line length (see picture). Programatically, create a temporary circle as discribe, get the intersection points, delete the circle... Appologies for my poor English. Quote
roseanna Posted April 1, 2010 Author Posted April 1, 2010 Gile, Works Perfectly. Thanks RoseAnna Quote
tagkelas Posted April 1, 2010 Posted April 1, 2010 gile Very good Euclidean Geometry! This will help me a lot... Quote
David Bethel Posted April 2, 2010 Posted April 2, 2010 Taking the next step, you could determine the triangle A-B-C using the 3 known side values ( SideSideSide ) AB Radius Of The Circle AC and BC The Half Distance Known points A and C locate the triangle Then find D as a perpendicular of B on AC. Now you have 2 right triangles to deal with. Or there probably is some vlax call that finds the intersection points..... -David Quote
Lee Mac Posted April 2, 2010 Posted April 2, 2010 Or there probably is some vlax call that finds the intersection points..... But where's the fun in that Quote
gile Posted April 2, 2010 Posted April 2, 2010 Hi, No need to build the C point the triangle circle center, tangent point, external point is always rectangle at tangent point (a tangent to a circle is perpendicular to the radius at this point) Quote
David Bethel Posted April 2, 2010 Posted April 2, 2010 Hi, No need to build the C point the triangle circle center, tangent point, external point is always rectangle at tangent point (a tangent to a circle is perpendicular to the radius at this point) I understand the perpendicular. I don't understand how you could reproduce the triangle. You really only know the length of the hypotenuse and the 90 degree angle. How could calculate either the length of either other side ( which are chords of an unknown arc ) or either other angle? -David Quote
David Bethel Posted April 2, 2010 Posted April 2, 2010 But where's the fun in that I agree. Also, where the knowledge? -David Quote
gile Posted April 2, 2010 Posted April 2, 2010 I understand the perpendicular. I don't understand how you could reproduce the triangle. You really only know the length of the hypotenuse and the 90 degree angle. How could calculate either the length of either other side ( which are chords of an unknown arc ) or either other angle? -David Asumming you know the circle datas (center and radius) and the external point, you know the length of the hypotenuse and the length of the side from the circle center to the 90 degree angle (tangent point) which is equal to the circle radius... Quote
Lee Mac Posted April 3, 2010 Posted April 3, 2010 Asumming you know the circle datas (center and radius) and the external point, you know the length of the hypotenuse and the length of the side from the circle center to the 90 degree angle (tangent point) which is equal to the circle radius... I use this reasoning in this thread Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.