# Draw circle perpendicular to line

I was trying to create a circumference perpendicular to a line similar to this

but I only see a tutorial for creating in a axis-plane (xy, xz, yz)

\documentclass[tikz, border=15mm]{standalone}
\usetikzlibrary{arrows,calc, decorations.markings, intersections}

\begin{document}

\begin{tikzpicture}[scale=.8]
\draw (0,0,0) -- (xyz cs:x=6);
\draw (0,0,0) -- (xyz cs:y=6);
\draw[name path=axe] (.5,.5)--(5,5);
%
\node[inner sep=0, outer sep=0] at (1,2) (a) {};
\node[inner sep=0, outer sep=0] at (2,3.5) (b) {};
\node[inner sep=0, outer sep=0] at (3,5) (c) {};
\node[inner sep=0, outer sep=0] at (4,4) (d) {};
\node[inner sep=0, outer sep=0] at (4,2.5) (e) {};
\node[inner sep=0, outer sep=0] at (3,1) (f) {};
%
plot [smooth cycle, tension=.8] coordinates { (a) (b) (c) (d) (e) (f)};
%
\draw [dashed, name intersections={of=axe and mold}]
(intersection-1) --(intersection-2);
\fill [name intersections={of=axe and mold}]
(intersection-1) circle (2pt)
(intersection-2) circle (2pt)
(2.2,2.2) circle (2pt)
(3.2,3.2) circle (2pt);
\end{tikzpicture}
\end{document}


If full ellipse is good enough you can just rotate it. If you need an ellipse with break you can draw it using \pgfpatharcaxes (or similar command).

\documentclass[tikz, border=15mm]{standalone}
\usepackage{xcolor}
\usetikzlibrary{arrows,calc, decorations.markings, intersections}
\begin{document}
\begin{tikzpicture}[scale=.8]
\draw (0,0,0) -- (xyz cs:x=6);
\draw (0,0,0) -- (xyz cs:y=6);
\draw[name path=axe] (.5,.5)--(5,5);

\node[inner sep=0, outer sep=0] at (1,2) (a) {};
\node[inner sep=0, outer sep=0] at (2,3.5) (b) {};
\node[inner sep=0, outer sep=0] at (3,5) (c) {};
\node[inner sep=0, outer sep=0] at (4,4) (d) {};
\node[inner sep=0, outer sep=0] at (4,2.5) (e) {};
\node[inner sep=0, outer sep=0] at (3,1) (f) {};

plot [smooth cycle, tension=.8] coordinates { (a) (b) (c) (d) (e) (f)};
\draw [dashed, name intersections={of=axe and mold}]
(intersection-1) --(intersection-2);
\fill [name intersections={of=axe and mold}]
(intersection-1) circle (2pt)
(intersection-2) circle (2pt)
(2.2,2.2) circle (2pt)
(3.2,3.2) circle (2pt);
\definecolor{lightblue}{RGB}{42,174,229}
\pgfsetlinewidth{2\pgflinewidth}
\pgfsetcolor{lightblue}
\draw[rotate=45] ({sqrt(2)*2.2},0) ellipse (0.2 and 1);
circle (0.1cm) node[xshift=4pt,yshift=-2pt]{\tiny{A}};
\begin{pgfscope}
\pgftransformrotate{45}
\pgfpathmoveto{\pgfpoint{sqrt(2)*3.2cm+0.15cm}{0.07cm}}
\pgfpatharcaxes{5}{355}{\pgfpoint{0.15cm}{0mm}}{\pgfpoint{0}{0.75cm}}
\pgfusepath{draw}
\end{pgfscope}
circle (0.1cm) node[xshift=5pt,yshift=-1pt]{\tiny{B}};
\end{tikzpicture}
\end{document}


• +1, but I would remove the draw options to the balls :) – Claudio Fiandrino Apr 15 '14 at 11:57

Something like this?

\documentclass[border=3mm]{standalone}

\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}

\begin{tikzpicture}
\begin{scope}[rotate=60]
\draw (0,0) --++(0:5);
\end{scope}

\begin{scope}[xshift=5cm]
\draw (0,0) --++(30:5);
\end{scope}
\end{tikzpicture}

\end{document}