Forgot password?

Create an account!

Forum

« back

RhinoScript – How to create a line tangent to a circle

Messages

Please log in to write a message.

  • 6. Brightflame (Sep 10, 2012 10.05):

    Hey guys, thanks for your help but i found a solution that works, it is rather long winded but it does the job. Basically i drew a line from the point to the centre of the circle, then drew another circle from the midpoint of the line to the end of the line, and got the intersection points.

    Thanks for your help guys.

    Rob

  • 5. Hanno (Sep 07, 2012 11.36):

    I'd say that depends on which point is given - the one on the circle or the other one.

  • 4. Johannes (Sep 07, 2012 06.31):

    hi, what about Rhino.CurveTangent(strCurve, dblParam)?
    Gives you the tangent vector at a specific point on your curve (circle). Then you just need some vector calculation to add the vector to the point to create a line.

    Johannes

  • 3. Hanno (Sep 07, 2012 00.05):

    Hi,

    sure this is possible, you just need some trigonometry: You have a point and a circle and want a tangent to the circle through your point. Imagine a right-angled triangle where the hypotenuse goes from your point to the circle center and the third point lies on the circle. So the leg opposite to your point is the circle radius. Opposite leg divided by hypothenuse gives you the sinus, so asin(radius/centerdist) gives you the angle by which you have to rotate a line from your point to the center to make it a tangent.

    Now you just need to translate it into code :-)

    Hanno

  • 2. Brightflame (Sep 05, 2012 19.56):

    Sorry, forgot to add picture, but im sure you all know what it looks like.

    Rob

  • 1. Brightflame (Sep 05, 2012 19.53):

    Hi,

    i was wondering if it was possible to script the "line tangent to a curve" function in rhinoscript, because i can't seem to select the circle so that it dynamically moves around the curve.

    Many Thanks,

    Rob

Recommend

Why are these buttons gray?