# Drawing a curve between two axes

I would like to draw a curve, giving the impression that an axis is mapped to another one with the the Greek character rho above, like the image below.

I would also like that there is a small square at the intersection of the axes giving the impression that the angle is a right angle.

So far I have the below code (burrowed partially from some codes already available at this site).

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

\begin{center}
\begin{tikzpicture}[scale=.5]
\draw [dashed] (2,2) --  (4, 4);
\draw [->] (4, 4) -- (5.5, 5.5);
\draw [dashed] (2,2) --  (-.25, 3.678) ;
\draw [->] (-.25, 3.687) -- (-2, 5);
\draw (2,2) circle (3cm);
\draw[dashed] (2,2) ellipse (3cm and 1cm);
\clip (-1.1,2) rectangle (5.1 cm, 0.9 cm);
\draw (2,2) ellipse (3cm and 1cm);
\end{tikzpicture}
\end{center}
\end{document}


• Maybe you should search for drawing angles between lines (there are some question on this site). – TeXnician Apr 16 '17 at 14:24

If you make the diagram using polar coordinates, then you can use an arc to draw that arrow. There are some comments in the code below, ask if you'd like some more clarifications.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}[
declare function={
theta=45; % angle of right arrow
}]
% draw circle, and place coordinate at center
% define two helper coordinates, where the dashed lines should meet the circle
\path (O) +(theta:R) coordinate (a)
+(theta+90:R) coordinate (b);
% draw arc with solid part of equator
% draw ard for dashed part of equator
% draw the dashed lines to the center of the circle
\draw [dashed] (a) -- (O) -- (b);
% draw the two arrows that extend out of the circle
\draw [-latex] (O) ++(theta:R) -- ++(theta:0.75*R);
\draw [-latex] (O) ++(theta+90:R) -- ++(theta+90:0.75*R);

% draw the arced arrow with rho above
\draw [-latex] (O) ++(theta+80:R*1.2)
node[midway,above] {$\rho$};

% draw the right angle mark
\draw (O) ++(theta:R/10) -- ++(theta+90:R/10) -- ++(180+theta:R/10);
\end{tikzpicture}
\end{center}
\end{document}


Alternatively, you can use the predefined pic called angle, which is defined by the angles library. The quotes library is needed for the "$\rho$" label.

I suggest a slightly different way of making that diagram, but also added the arrow to your code. Haven't done the square part there though, but the angle isn't 90 degrees there (in your diagram). Try adding \draw [rotate around={45:(2,2)}] (2,2) rectangle (2.5,2.5); before the \clip to see that.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{angles,quotes,bending}
\begin{document}
\begin{center}
\begin{tikzpicture}[declare function={R=1.5cm;theta=45;}]
\draw [dashed] (180-theta:R) -- (O) -- (theta:R);
\draw [-latex] (theta:R) -- (theta:1.5*R) coordinate (a);
\draw [-latex] (180-theta:R) -- (180-theta:1.5*R) coordinate (b);
\draw pic [
shorten >=2mm,
shorten <=2mm,
draw,
latex-,
angle eccentricity=1.1,
"$\rho$"] {angle=a--O--b};

\draw (O) ++(theta:R/10) -- ++(180-theta:R/10) -- ++(180+theta:R/10);
\end{tikzpicture}
\begin{tikzpicture}[scale=.5]
\draw [dashed] (2,2) coordinate (O) --  (4, 4);
\draw [->] (4, 4) -- (5.5, 5.5) coordinate (a);
\draw [dashed] (2,2) --  (-.25, 3.678) ;
\draw [->] (-.25, 3.687) -- (-2, 5) coordinate (b);
\draw (2,2) circle (3cm);
\draw[dashed] (2,2) ellipse (3cm and 1cm);
\draw pic [
shorten >=2mm,
shorten <=2mm,
draw,
latex-,
angle eccentricity=1.1,
"$\rho$"] {angle=a--O--b};

\clip (-1.1,2) rectangle (5.1 cm, 0.9 cm);
\draw (2,2) ellipse (3cm and 1cm);
\end{tikzpicture}
\end{center}
\end{document}

• Many thanks. Let me wait for possible alternative solutions before accepting this. – Name Apr 16 '17 at 14:48
• @Name I added a different method as well. – Torbjørn T. Apr 16 '17 at 15:11

A PSTricks solution:

\documentclass{article}

\usepackage{pstricks}

\begin{document}

\begin{pspicture}(-2.5,-2)(2.5,3.4)
\pscircle(0,0){2}
\psellipticarc(0,0)(2,1){180}{0}
{\psset{linestyle = dashed}
\psellipticarc(0,0)(2,1){0}{180}
\psline(!2 2 sqrt div neg  2 2 sqrt div)(0,0)%
(!2 2 sqrt div      2 2 sqrt div)}
\psline{->}(!2 2 sqrt div neg  2 2 sqrt div)(-2.5,2.5)
\psline{->}(!2 2 sqrt div      2 2 sqrt div)( 2.5,2.5)
\psline(-0.2,0.2)(0,0.4)(0.2,0.2)
\psarc{<-}(0,0){3}{50}{130}
\uput[90](0,3){$\rho$}
\end{pspicture}

\end{document}