# Plotting conjugate diameters of an ellipse

Good morning, I'm drawing an ellipse with its conjugate deameters. My MWE

\documentclass{standalone}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}

\begin{document}
\begin{tikzpicture}
\begin{axis}[domain=0:360,no markers]
\pgfplotsinvokeforeach{-4,-3,-2,-1,0,1,2,3,4}{
}
\end{axis}
\end{tikzpicture}

\end{document}


Questions - how to make straight lines longer enough? How to make an ellipse smoother? Thanks!

• for smoother draw of ellipse ad smooth option to tikzpicture or to addplot. Regarding lines, I don't understand what you meaning with "longer". Where they should be (from where to where)? – Zarko Apr 19 '16 at 6:23
• They should fill an ellipse. Every line has its ends on elipse – Olga K Apr 19 '16 at 6:26
• Than you have mathematical problem :-) Coordinates for lines are wrong calculated. They should be on ellipse border. Another solution is use intersection library .... see description in the section "13.3.2 Intersections of Arbitrary Paths" on page 136 of recent TikZ manual. There are some examples how to do this. – Zarko Apr 19 '16 at 6:34
• Give me the link on recent Tikz manual please – Olga K Apr 19 '16 at 6:39
• Here it is: ctan.mirror.garr.it/mirrors/CTAN/graphics/pgf/base/doc/… (look at section 13.3.2) – Enrico Maria De Angelis Apr 19 '16 at 6:42

I don't know what conjugate diameters are, but with an ellipse shaped node and its polar anchors, it's easy to draw lines between any two points on ellipse border.

\documentclass[border=2mm]{standalone}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}

\begin{document}
\begin{tikzpicture}
\node[ellipse, draw, minimum width=3cm, minimum height=2cm] (A) {};

\draw (A.30)--(A.210);
\draw (A.40)--(A.200);
\draw (A.120)--(A.300);
\end{tikzpicture}

\end{document}


• my congradulations, now you know about conj diamaters)) And I know about anchors. Probably, your treat is useful. – Olga K Apr 19 '16 at 7:07

Ok, due to all recommendations above I arrived to folowing

\documentclass{standalone}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}[help lines/.style={blue!30,very thin},scale=0.6]
\draw [help lines] (-6, -3) grid (6, 3);
\draw[->] (-6, 0) -- (6, 0) node[below]{\footnotesize $x$};
\draw[->] (0, -3) -- (0, 3) node[right]{\footnotesize $y$};
\draw[color=blue,very thick] (0, 0) ellipse (4cm and 2cm);

\draw[-,green!50!black] (2, -2) -- (5, 1) ;
\draw[-,green!50!black] (1, -2) -- (4, 1) ;
\draw[-,green!50!black] (0, -2) -- (4, 2);
\draw[-,green!50!black] (-1, -2) -- (3, 2);
\draw[-,green!50!black] (-2, -2) -- (2, 2);

\draw[-,green!50!black] (-5, -1) -- (-2, 2) ;
\draw[-,green!50!black] (-4, -1) -- (-1, 2) ;
\draw[-,green!50!black] (-4, -2) -- (0, 2) ;
\draw[-,green!50!black] (-3, -2) -- (1, 2) ;

\draw[-,red] (-4, 1) -- (4, -1) ;
\draw[-,red] (-3, 2) -- (5, 0) ;
\draw[-,red] (-5, 0) -- (3, -2);

\end{tikzpicture}
\end{document}