In this MWE there is tangent with help of the answer of @Jake in How do I make tangents to ellipses and lines parallel to these? But I do not succeed in using this point that I got by tangent=0.35 later on in order to connect it with F1 and F2. In other words: The blue and the black point on the ellipsis line should be the same but how can I get it exact without guessing the angle of the point where I've drawn the tangent?

  dot/.style={draw,fill,circle,inner sep=1pt},
            markings,% switch on markings
                at position #1
                    \coordinate (tangent point-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,0pt);
                    \coordinate (tangent unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (1,0pt);
                    \coordinate (tangent orthogonal unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,1);
    use tangent/.style={
        shift=(tangent point-#1),
        x=(tangent unit vector-#1),
        y=(tangent orthogonal unit vector-#1)
    use tangent/.default=1
  \def\a{4} % major half axis
  \def\b{2} % minor half axis
  \draw[thick, tangent=0.35] (0,0) ellipse ({\a} and {\b});
  \fill (tangent point-1) circle [radius=2pt];
  \draw [use tangent] (2,0) -- (-2,0);
  \def\angle{125} % angle for point on ellipse
  %Labelling the foci
  \node[dot,label={below:$F_1$}] (F1) at ({-sqrt(\a*\a-\b*\b)},0) {};
  \node[dot,label={below:$F_2$}] (F2) at ({+sqrt(\a*\a-\b*\b)},0) {};
  %Point on ellipsis
  \node[dot,label={\angle:$P$},blue] (P) at (\angle:{\a} and {\b}) {};
  \draw (F1) -- (P) (P) -- (F2);

enter image description here

  • You can minimize a lot your code, using tkz-euclide.
    – SebGlav
    Jun 1, 2021 at 16:05
  • is your ellipse rotated? By the way, there is a tikz code here (geometric way) tex.stackexchange.com/a/540341/140722
    – Black Mild
    Jun 2, 2021 at 3:10
  • @Black Mild Thanks, that's elegant! (No, my ellipse is not rotated.)
    – ubuntuuser
    Jun 2, 2021 at 9:43

4 Answers 4


With a bit of help from tkz-euclide and in particular the bisector out macro, this is pretty straightforward. This is achievable in simple TikZ with calc library but here is a simple line to obtain the tangent.

tangent to an ellipse



    \begin{tikzpicture}[dot/.style={draw,fill,circle,inner sep=1pt},]
        \def\a{4} % major half axis
        \def\b{2} % minor half axis
        \draw[thick] (0,0) ellipse ({\a} and {\b});
        \node[dot,label={below:$F_1$}] (F1) at ({-sqrt(\a*\a-\b*\b)},0) {};
        \node[dot,label={below:$F_2$}] (F2) at ({+sqrt(\a*\a-\b*\b)},0) {};
        \def\angle{125} % angle for point on ellipse
        \node[dot,label={\angle:$P$},blue] (P) at (\angle:{\a} and {\b}) {};
        \draw (F1) -- (P) -- (F2);
        \tkzDefLine[bisector out](F1,P,F2) \tkzGetPoint{K}
        \draw ($(K)!-2!(P)$)--($(P)!-2.5!(K)$);

I usually prefer to code everything in tkz-euclide when possible, but I thought that you would keep your original code instead.


While you are waiting for the TikZ cavalry, here is one I did earlier in Metapost for comparison.

enter image description here

Metapost has the useful concept of (fractional) points along a path. In the case of an ellipse there are 8 points starting at "3 o'clock".

  • point t of E gives you a pair of coordinates for the point
  • direction t of E gives you a pair that represents the tangent at that point

To get a nice line to draw I have used angle to find the rotation of the direction and applied it to a known line...

vardef focus(expr e, n) = 
  numeric a,b;
  a = arclength (point 0 of e .. center e);
  b = arclength (point 2 of e .. center e);
  ((a+-+b)/a)[center e, point if n=1: 4 else: 0 fi of e]


path E; E = fullcircle xscaled 233 yscaled 144 rotated 8; 
numeric t; t = 2.7182818;

z0 = point t of E;
z1 = focus(E,1);
z2 = focus(E,2);

path tangent; 
tangent = (left--right) scaled 42 
        rotated angle direction t of E
        shifted point t of E;

drawoptions(withcolor 3/4);
draw point 0 of E -- point 4 of E withcolor .7 white;
draw point 2 of E -- point 6 of E withcolor .7 white;

drawoptions(withcolor 3/4 red);
draw tangent;
draw z1 -- z0 -- z2;

drawoptions(withcolor 5/8 blue);
draw E;

dotlabel.lrt(btex $F_1$ etex, z1);
dotlabel.lrt(btex $F_2$ etex, z2);
dotlabel.ulft(btex $P$   etex, z0);


The supplied focus routine does the arithmetic to find you the focus points given an elliptical path. This is wrapped in luamplib so compile with lualatex.


A geometric method use the fact that the normal line at a point on a ellipse is the internal bisector of the angle from that point to two foci. A TikZ way is in here with the user-defined command bisectorpoint.

In Asymptote, bisector direction is a built-in command.

pair dir(path p, path q)
returns unit(dir(p)+dir(q)).

In particular,

pair Mn=M+dir(M--F1,M--F2); 
pair Mt=rotate(90,M)*Mn;

give the point Mn on the normal line and the point Mt on the tangent line at M of the ellipse.

enter image description here

real a=3, b=2;
real c=sqrt(a^2-b^2);
pair F1=(-c,0), F2=(c,0);
real t=130;
pair M=(a*Cos(t),b*Sin(t));  // a point on the ellipse
// M--Mn is the internal bisector of MF1 and MF2 
pair Mn=M+dir(M--F1,M--F2); 
pair Mt=rotate(90,M)*Mn;



Using tzplot:

enter image description here




\def\a{4} % major half axis
\def\b{2} % minor half axis
\tzellipse[thick]"AA"(0,0)({\a} and {\b})


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.