# Defining intersections and nodes

I've replicated the figure below through the following MWE

\documentclass[12pt,a4paper]{article}

\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}[dot/.style={circle,inner sep=1pt,fill,label={#1},name=#1}]

\coordinate (A) at (0,0);
\coordinate (M) at (2.8,2.8);

\draw[thick, ->](0,0)--(4.5,0) node[anchor=north west, font=\small]{state 1 payoff};
\draw[thick, ->](0,0)--(0,4.5) node[anchor=south east, font=\small]{state 2 payoff};

\draw[dashed, ->] (0,0)--(2.8,2.8);

\draw ($(A)!1.5!270:(1.2,1.6)$)--($(A)!3cm!90:(1.2,1.6)$) node[pos=0.1, right=1pt, font=\small]{price=0 (excess returns)};

\draw[blue,-latex] (0,0)--(1.2,1.6) coordinate[pos=2.8] (y) node[anchor=south east, font=\small]{$\Phi$};
\draw[blue, dashed] (1.2,1.6)--(y) coordinate[pos=0.1](z1) coordinate[pos=0.8](z2);

\foreach \X in {1,2}
{\draw ($(z\X)!2.5cm!270:(A)$) -- ($(z\X)!4cm!90:(A)$) node[pos=0.8,right=1pt, font=\small]{price=$\X$};
}

\draw (intersection cs: first line={($(z1)!2.5cm!270:(A)$)--($(z1)!4cm!90:(A)$)}, second line={(A)--(M)})
node[fill, inner sep=1pt,circle, font=\small, dot=above right:riskfree rate]{} coordinate(x);

\draw (0:0.5) arc (0:45:0.5) node[pos=0.5,right=0.5pt, font=\tiny]{$45^{o}$};

\end{tikzpicture}

\end{document}


This is a first attempt and there are some things to be fixed, so my code looks messy. I'd like to know how can I draw the price=0 line inside the foreachcycle, as I did for the other two perpendicular lines. I tried to include it in the code, by defining the coordinates z1,z2,z3, but I suppose the problem arises with the position of z1, which was set at the origin. I think I'm still a bit confused about the syntax of the perpendicular lines. Moreover, I'd like to include the point "state 1 contingent claims", which should lie at the intersection point between the line perpendicular to the x-axis and the x-axis itself. I tried with \node[...] at (intersection...) {}; but it didn't work. Thank you.

Yes, as you suspected you cannot draw an orthogonal line of a line of length 0. The following does all three orthogonal lines in a loop. To make it work I added an auxiliary coordinate aux. The additional text at \X=0 is added via \ifnum\X=0\relax (excess returns)\fi such that it only appears there.

\documentclass[12pt,a4paper]{article}

\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}[dot/.style={circle,inner sep=1pt,fill,label={#1},name=#1}]

\coordinate (A) at (0,0);
\coordinate (M) at (2.8,2.8);

\draw[thick, ->](A)--(4.5,0) node[anchor=north west, font=\small]{state 1 payoff};
\draw[thick, ->](A)--(0,4.5) node[anchor=south east, font=\small]{state 2 payoff};

\draw[dashed, ->] (A)--(2.8,2.8);

\draw[blue,-latex] (A)--(1.2,1.6) coordinate[pos=2.8] (y) node[anchor=south east, font=\small]{$\Phi$}
coordinate[pos=0](z0) coordinate[pos=-0.4](aux);
\draw[blue, dashed] (1.2,1.6)--(y)  coordinate[pos=0.1](z1) coordinate[pos=0.8](z2);

\foreach \X in {0,1,2}
{\draw ($(z\X)!2.5cm!270:(aux)$) -- ($(z\X)!4cm!90:(aux)$)
node[pos=0.8,right=1pt, font=\small]{price=$\X$ \ifnum\X=0\relax (excess returns)\fi};
}

\draw (intersection cs: first line={($(z1)!2.5cm!270:(A)$)--($(z1)!4cm!90:(A)$)}, second line={(A)--(M)})
node[fill, inner sep=1pt,circle, font=\small, dot=above right:riskfree rate]{} coordinate(x);

\draw (0:0.5) arc (0:45:0.5) node[pos=0.5,right=0.5pt, font=\tiny]{$45^{o}$};

\end{tikzpicture}

\end{document} • thank you again, @marmot. I'd like to include the point "state 1 contingent claims" also, which should lie at the intersection point between the line perpendicular to the x-axis (from the point of the riskfree rate) and the x-axis itself. I tried with \node[...] at (intersection...) {}; but it didn't work. it would be sufficient to assign a name to the riskfree point, and just draw the perpendicular, isn't it? – Nenne May 11 at 15:33
• @Nenne You could just add it to the horizontal axis: \draw[thick, ->](A)--(4.5,0) node[anchor=north west, font=\small]{state 1 payoff} node[pos=0.25,circle,fill,inner sep=1pt,label={[font=\tiny,xshift=-1ex,align=left]above right:state 1 contin-\\gent claims}]{};. – user121799 May 11 at 16:09