Jump to content

Recommended Posts

Posted

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

Posted

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.

Tangent.png

Posted

Gile,

 

Works Perfectly. Thanks

 

RoseAnna

Posted

gile

Very good Euclidean Geometry! This will help me a lot...

Posted

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

Tangent1.jpg

Posted
Or there probably is some vlax call that finds the intersection points.....

 

But where's the fun in that :P

Posted

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)

Tangent 2.png

Posted
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

Posted
But where's the fun in that :P

 

I agree. Also, where the knowledge? :) -David

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

Posted
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 :)

  • 3 months later...
Posted

Thanks gile....just used that one!!!!!!!!!!!! :)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...