# Draw a tangent line from a circle

**URL:** <https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615>\
**Category:** Rhino for Windows\
**Created:** [November 10, 2016, 8:36am UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615 "2016-11-10T08:36:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charles](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/charles/32/747625_2.png) [@Charles](https://discourse.mcneel.com/u/Charles)\
**Post date:** [November 10, 2016, 8:36am UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/1 "2016-11-10T08:36:27Z")

</div>

Hello,

I have a circle which I want to draw a tangent line from.  
Desired angle is 30.  
 ![](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/8/c/8c42b64af483f6c6a0526c7a299f687d615fad2c.png)

I can drag the line to some point, but can’t fix the angle.

**Angle constraint doesn’t work.**  
**While I think it should…**

* * *

And yes, I can draw the line from the center and then offset it.

There must be a smarter way.  
Anyone knows?

-C-H-A-R-L-E-S-

---

<div class="post-metadata">

**Author:** ![2DCube](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/2dcube/32/62428_2.png) [@2DCube](https://discourse.mcneel.com/u/2DCube)\
**Post date:** [November 10, 2016, 10:45am UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/2 "2016-11-10T10:45:08Z")

</div>

30 degrees from where…? The tangent line is touching the circle but you’d have to specify the line length and from what base point you’d like the angle to start from etc.

In this instance you could draw the base curve along the x axis and the desired curve/length at 30 degrees and then use the tan tan radius command to draw your circle?

## There are other commands \_TangentFrom if you press ctrl over the object snap tick boxes.

Andy

---

<div class="post-metadata">

**Author:** ![Helvetosaur](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/helvetosaur/32/635974_2.png) [@Helvetosaur](https://discourse.mcneel.com/u/Helvetosaur)\
**Post date:** [November 10, 2016, 10:52am UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/3 "2016-11-10T10:52:44Z")

</div>

> [@Charles](#):
>
> Angle constraint doesn’t work.  
> While I think it should…

Yes, it would be good if it worked like this:

`Line Tangent`, pick the circle, then `<120` - which should constrain the snap point to a one of two places on the circle. You would then need to click to choose which of the two points you want for the line start, then type a distance or pull out the line and click to fix the end point…

–Mitch

---

<div class="post-metadata">

**Author:** ![markintheozarks](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/markintheozarks/32/678563_2.png) [@markintheozarks](https://discourse.mcneel.com/u/markintheozarks)\
**Post date:** [November 10, 2016, 11:10am UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/4 "2016-11-10T11:10:39Z")

</div>

I used , one time tangent from. Made line, then rotated it from circle center 30 degrees.—fwiw. Mark

---

<div class="post-metadata">

**Author:** ![Charles](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/charles/32/747625_2.png) [@Charles](https://discourse.mcneel.com/u/Charles)\
**Post date:** [November 10, 2016, 11:35am UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/5 "2016-11-10T11:35:43Z")

</div>

The several workarounds for a tangent line from a circle are easy.  
In fact we wouldn’t need the tangent snap.

And what to do if it is not a circle but an arbitrary curve?  
Then the angle constraint would help…

---

<div class="post-metadata">

**Author:** ![Charles](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/charles/32/747625_2.png) [@Charles](https://discourse.mcneel.com/u/Charles)\
**Post date:** [November 10, 2016, 11:39am UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/6 "2016-11-10T11:39:30Z")

</div>

> [@2DCube](#):
>
> 30 degrees from where…?

That exactly could be calculated from the angle constraint…  
Now we can move the prospected line free or snap the endpoint to somewhere.  
The tangent point is calculated while moving.  
This could be also done when a constraint kicks in.

Or?

---

<div class="post-metadata">

**Author:** ![2DCube](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/2dcube/32/62428_2.png) [@2DCube](https://discourse.mcneel.com/u/2DCube)\
**Post date:** [November 10, 2016, 11:43am UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/7 "2016-11-10T11:43:42Z")

</div>

Yeah I can see that now. I was thinking of the problem based purely on the circle example you gave but it would be a bit more user friendly based on your proposal/question.

- 

Andy

---

<div class="post-metadata">

**Author:** ![davidcockey](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidcockey/32/771921_2.png) [@davidcockey](https://discourse.mcneel.com/u/davidcockey)\
**Post date:** [November 10, 2016, 1:51pm UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/8 "2016-11-10T13:51:57Z")

</div>

A method which works for arbitray curves:

Draw a line with the desired angle.Position it near the apparent tangent point on the curve.

CurveDeviation with KeepMarks=Yes for the line and curve. The tangent point will be the

Move the line to the tangent point, or draw a new line at the desired angle starting from the tangent point.

[Tangent line at angle DC.3dm](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/1/6/168986883deffb06bf9f29326d8f2c93c1a00409.3dm) (40.1 KB)  
.

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [November 10, 2016, 3:48pm UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/9 "2016-11-10T15:48:17Z")

</div>

Hi All - Is this request/suggestion only for angles relative to the CPlane X? What would happen on non-planar curves or planar curves not parallel to the CPlane?

-Pascal

---

<div class="post-metadata">

**Author:** ![Charles](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/charles/32/747625_2.png) [@Charles](https://discourse.mcneel.com/u/Charles)\
**Post date:** [November 10, 2016, 3:55pm UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/10 "2016-11-10T15:55:37Z")

</div>

> [@davidcockey](#):
>
> CurveDeviation with KeepMarks=Yes

Nice!

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [November 10, 2016, 3:58pm UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/11 "2016-11-10T15:58:04Z")

</div>

`ClosestPt` will also help here… same idea.

Here’s a quick Python to move the line to the curve to the target tangent in cases where that is possible.

```
 import rhinoscriptsyntax as rs   

```

`def test():`

```
crvId1 = rs.GetObject("Select the curve to move", 4, preselect=True)
if crvId1 is None: return

crvId2 = rs.GetObject("Select the target object", 4+8+16, preselect=False)
if crvId2 is None: return

Id, p1, p2 = rs.CurveClosestObject(crvId1, crvId2)
rs.MoveObject(crvId1, p1-p2)

```

`test()`

Works with surfaces & polysurfaces as the target as well, bonus!

A smarter way would be to check if the closest point on the target curve has a tangent parallel to the moved curve at its end of the closest point line, and not move the curve if the tangents are not parallel. And if it’s a line move the end point not the closest point…etc.  
Later.

-Pascal

---

<div class="post-metadata">

**Author:** ![AlW](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/alw/32/53821_2.png) [@AlW](https://discourse.mcneel.com/u/AlW)\
**Post date:** [November 10, 2016, 3:58pm UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/12 "2016-11-10T15:58:30Z")

</div>

Isn’t it true that ANY curve has at any given point on it an infinitesimal local 3D direction which a tangency constraint MUST obey? Enforcing tangency at a joint on the line would thus, in the general case, also restrict the direction of the tangent line. Devising a tangent-point seeking technique in the scenario where the designer would like to specify the (general) curve to be tangent to and then place the other end of the line interactively might be pretty challenging, but really cool if implemented.

---

<div class="post-metadata">

**Author:** ![Charles](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/charles/32/747625_2.png) [@Charles](https://discourse.mcneel.com/u/Charles)\
**Post date:** [November 10, 2016, 4:06pm UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/13 "2016-11-10T16:06:52Z")

</div>

> [@AlW](#):
>
> place the other end of the line interactively might be pretty challenging, but really cool if implemented.

That is already there, we can move the endpoint of the line as we like.

---

<div class="post-metadata">

**Author:** ![AlW](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/alw/32/53821_2.png) [@AlW](https://discourse.mcneel.com/u/AlW)\
**Post date:** [November 10, 2016, 4:27pm UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/14 "2016-11-10T16:27:54Z")

</div>

On a general 3D curve, or just a planar curve? I must admit I’ve only used it on planar curves like circles and arcs.

---

<div class="post-metadata">

**Author:** ![davidcockey](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidcockey/32/771921_2.png) [@davidcockey](https://discourse.mcneel.com/u/davidcockey)\
**Post date:** [November 10, 2016, 4:53pm UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/15 "2016-11-10T16:53:50Z")

</div>

The method using CurveDeviation or ClosestPt only finds the tangent point when the line and curve are coplanar.

---

<div class="post-metadata">

**Author:** ![RIL](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ril/32/771758_2.png) [@RIL](https://discourse.mcneel.com/u/RIL)\
**Post date:** [November 10, 2016, 5:18pm UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/16 "2016-11-10T17:18:20Z")

</div>

> [@AlW](#):
>
> On a general 3D curve, or just a planar curve?

I’m also struggling with this at times.

**3D Arcs**  
I experience problems also when trying to draw arcs in 3D. I’m probably missing something but if anyone has a hint to a straightforward way to draw an arc in two planes simultaneously it’d be very helpful.

// Rolf

---

<div class="post-metadata">

**Author:** ![markintheozarks](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/markintheozarks/32/678563_2.png) [@markintheozarks](https://discourse.mcneel.com/u/markintheozarks)\
**Post date:** [November 10, 2016, 6:15pm UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/17 "2016-11-10T18:15:03Z")

</div>

I wonder if (crv from 2 views ) this could be a begining point. — Mark

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [November 10, 2016, 6:30pm UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/18 "2016-11-10T18:30:48Z")

</div>

Hi Rolf - there is a `Tilted` option in the `Arc` command line after the center has been set. Dunno if that would help with what you are doing.

-Pascal

---

<div class="post-metadata">

**Author:** ![davidcockey](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidcockey/32/771921_2.png) [@davidcockey](https://discourse.mcneel.com/u/davidcockey)\
**Post date:** [November 11, 2016, 12:13am UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/19 "2016-11-11T00:13:44Z")

</div>

> [@RIL](#):
>
> I experience problems also when trying to draw arcs in 3D. I’m probably missing something but if anyone has a hint to a straightforward way to draw an arc in two planes simultaneously it’d be very helpful.

@RIL Do you want the curve in 3d to be a circular arc? If so the projections to two planes will not be circular arcs.

Or do you want the projections to be circular arcs? If so the composite curve will not be a circular arc and may not be planar?

Or am I mis-interpreting what you want to do?

---

<div class="post-metadata">

**Author:** ![RIL](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ril/32/771758_2.png) [@RIL](https://discourse.mcneel.com/u/RIL)\
**Post date:** [November 11, 2016, 12:57am UTC](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615/20 "2016-11-11T00:57:23Z")

</div>

I sometimes want to draw a circular arc from a center point in any direction (i.e., in two planes). I’m doing some experiments with spheres and universal joints, and angles drawn in two planes are not the same as when measured in one plane, so I have rotated the CPlane as to make the arc in that one plane instead. So, recently I found out that I have reasons for reading up on spherical trigonometry ( [https://en.wikipedia.org/wiki/Spherical\_trigonometry](https://en.wikipedia.org/wiki/Spherical_trigonometry) ) 🙂

// Rolf

[Next page](https://discourse.mcneel.com/t/draw-a-tangent-line-from-a-circle/38615.md?page=2)
