# How do i get the tangent of an ellipse if I only have the angle of the mating line ?

Hi. I've been trying to solve this since 1:30 (Its now 6pm). I have an ellipse that needs to meet an arc. They both have to meet at a perfect tangent (because I am going loft many of these).
I've searched the web and my old geometry books, but can't get the answer.

CAD will get the tangent from a point, but I need to have perfect tangents at the angle. I'm happy with old geometry if there is no cad solution, I just need this to proceed with this job.

• edited May 2019 Accepted Answer

Another solution would be to use temporary 2D constraints:

1. Draw a line with the correct angle.
2. _GcFix the ellipse.
3. Add a _GcTangent constraint between the ellipse and the line.

Seems to work OK. Although sometimes the line is moved to the wrong side of the ellipse.

• Besides the Tangent entity snap option ( OSMODE flag 256 )
there is also the (V19.2) GEOMRELATIONS flag 1 which controls whether tangency between certain entity types will be indicated during grip editing of such entities.
Example: the start of an arc coincided with the endpoint of a line. While dragging the startpoint of the line back and forth you will get notified when the line becomes tangent to the end of the arc.
Unfortunately, this tangency indication is not (yet) supported for ellipses.
Perhaps, adding one or more auxiliary lines to snap to, you can construct what you're after?

Drawing a line that is tangent to an ellipse touches the ellipse in some desired point, is fairly straightforward to achieve with the 'regular' tangent snap option.

• I can only come up with a quick-and-dirty Lisp solution:

```(defun KGA_Sys_ObjectOwner (obj)
(vla-objectidtoobject (vla-get-database obj) (vla-get-ownerid obj))
)

(defun c:EllipseTangents ( / ang box doc enm linA linB obj tmp)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vla-endundomark doc)
(vla-startundomark doc)
(if
(and
(or
(= 1 (getvar 'worlducs))
(prompt "\nError: current UCS is not the WCS ")
)
(setq enm (car (entsel "\nSelect an ellipse: ")))
(setq obj (vlax-ename->vla-object enm))
(= "AcDbEllipse" (vla-get-objectname obj))
(or
(equal '(0.0 0.0 1.0) (vlax-get obj 'normal) 1e-8)
(prompt "\nError: OCS does not match the WCS ")
)
(or
(equal (* pi 2) (vla-get-endangle obj) 1e-8)
(prompt "\nError: not a full ellipse ")
)
(setq ang (getangle "\nAngle: "))
)
(progn
(setq tmp (vla-copy obj))
(vla-rotate tmp '(0.0 0.0 0.0) (- ang))
(setq box (vle-getboundingbox (vlax-vla-object->ename tmp)))
(setq linA
(KGA_Sys_ObjectOwner tmp)
(list (car (car  box)) (cadr (car box)) 0.0)
(list (car (cadr box)) (cadr (car box)) 0.0)
)
)
(setq linB
(KGA_Sys_ObjectOwner tmp)
(list (car (car  box)) (cadr (cadr box)) 0.0)
)
)
(vla-rotate linA '(0.0 0.0 0.0) ang)
(vla-rotate linB '(0.0 0.0 0.0) ang)
(vla-delete tmp)
)
)
(vla-endundomark doc)
(princ)
)
```
• @Roy Klein Gebbinck said:
Another solution would be to use temporary 2D constraints:

1. Draw a line with the correct angle.
2. _GcFix the ellipse.
3. Add a _GcTangent constraint between the ellipse and the line.

Seems to work OK. Although sometimes the line is moved to the wrong side of the ellipse.

ABSOLUTELY BRILLIANT !!
Worked like a charm. Also works for arcs if i Fix 3 points on the arc so it cant move or flex.

Thanks.

I never had much use for constraints before, but I'm going to have to look into them some more.

• @Roy Klein Gebbinck said:
Another solution would be to use temporary 2D constraints:

1. Draw a line with the correct angle.
2. _GcFix the ellipse.
3. Add a _GcTangent constraint between the ellipse and the line.

Seems to work OK. Although sometimes the line is moved to the wrong side of the ellipse.

Thanks Roy .. tucked away for future investigation.