SmtC: Show me the Code
Ole Peter Smith
Instituto de Matemática e Estatística
Universidade Federal de Goiás
http://www.olesmith.com.br

Points
O Homem é a espécie mais insana.
Venera um Deus invisível e destrói a Natureza visível…
Sem se aperceber de que esta Natureza, que ele destrói,
é o Deus invisível que ele venera
Hubert Reeves

Kleins Model

Tangent in Point $(R,\theta)$: \[ \begin{pmatrix} x-R\cos{\theta}\\ y-R\sin{\theta}\\ \end{pmatrix} \cdot \begin{pmatrix} \cos{\theta}\\ \sin{\theta}\\ \end{pmatrix} =0 \quad \Leftrightarrow \] \[ \cos{\theta}x+\sin{\theta}y=R \] Tangents in $P \sim (R,\theta_P)$, resp. $Q \sim (R,\theta_Q)$: \[ \begin{Bmatrix} \cos{\theta_p}x+\sin{\theta_p}y&=&R\\ \cos{\theta_q}x+\sin{\theta_q}y&=&R\\ \end{Bmatrix} \] Cramer: \[ \begin{pmatrix} x\\y \end{pmatrix} = \frac{1} { \begin{vmatrix} \cos{\theta_p}&\sin{\theta_p}\\ \cos{\theta_q}&\sin{\theta_q}\\ \end{vmatrix} } \begin{pmatrix} \begin{vmatrix} R&\sin{\theta_p}\\ R&\sin{\theta_q}\\ \end{vmatrix} \\\\ \begin{vmatrix} \cos{\theta_p}&R\\ \cos{\theta_q}&R\\ \end{vmatrix} \end{pmatrix} = \] \[ \frac{R} { \cos{\theta_p}\sin{\theta_q}-\cos{\theta_q}\sin{\theta_p} } \begin{pmatrix} \sin{\theta_q}-\sin{\theta_p} \\ \cos{\theta_p}-\cos{\theta_q} \end{pmatrix} = \] \[ \frac{R} { \sin{(\theta_q-\theta_p)} } \begin{pmatrix} \sin{\theta_q}-\sin{\theta_p} \\ \cos{\theta_p}-\cos{\theta_q} \end{pmatrix} \]
TiKZ Listing: Fig.tikz.tex. PDF   PNG   SVG   ZIP*  
\documentclass{standalone}

\usepackage{tikz}

\usetikzlibrary
{
   calc,math,
   intersections,
   angles,
}

\usepackage{tkz-euclide}
%%!
%%! For older versions of package tkz-euclide
%%! you may need uncomment the following line:
%   \usetkzobj{all}
%%!



\begin{document}
   \begin{tikzpicture}
       %Center
       \coordinate (O)  at (0,0);
       
       %Radius
       \tikzmath{\R=3;}
       
       \coordinate (i)  at (\R,0);
       \coordinate (ii) at (-\R,0);
       
       %Angles (in degrees)
       \tikzmath{\AngleP=35;}
       \tikzmath{\AngleQ=130;}
       \tikzmath{\AngleR=0.5*(\AngleP+\AngleQ);}
       
       
       \draw[thick] (O) circle (\R);
       \filldraw (O) circle (2pt);
       
       \coordinate (P) at ($(\AngleP:\R)$);
       \coordinate (Q) at ($(\AngleQ:\R)$);
       \coordinate (R) at ($(\AngleR:\R)$);
       \coordinate (S) at ($(P)!0.5!(Q)$);
       
       \draw[] (P) -- (Q);
       \filldraw (S) circle(2pt) node[anchor=south east] {$S$};
       
       %Should be first
       \foreach \P in {P,Q,R}
       {
          \draw[very thin] (O) -- (\P);
       }
       
       \draw[dotted,-latex] (O) -- (i);
       \draw[dotted] (O) -- (ii);
       
       \tkzMarkAngle[size=1](i,O,P);
       \tkzLabelAngle[pos=1.25](i,O,P) {$\theta_P$};
       
       \tkzMarkAngle[size=1](Q,O,ii);
       \tkzLabelAngle[pos=1.75](Q,O,ii) {$\pi-\theta_Q$};
       
       \tkzMarkAngle[size=0.5,mark=|](P,O,R);
       \tkzMarkAngle[size=0.5,mark=|](R,O,Q);
       
       \tkzMarkSegment[pos=0.5,mark=|](O,P);
       \tkzMarkSegment[pos=0.5,mark=|](O,Q);
       
       %Tangent and normal in P
       \coordinate (tp) at ($(\AngleP+90:1)$);
       \draw[-latex] (P) -- +(tp);
       
       %Tangent and normal in Q
       \coordinate (tq) at ($(\AngleQ+90:1)$);
       \draw[-latex] (Q) -- +(tq);
       
       \foreach \P in {P,Q,R}
       {
          \filldraw[white] (\P) circle (2pt);
          \draw (\P) circle (2pt);
          \node[above] at (\P) {$\P$};
       }
      
       %Calculate focus
       %Cos and sin of angles
       \tikzmath{\cosp=cos(\AngleP);}
       \tikzmath{\sinp=sin(\AngleP);}
       \tikzmath{\cosq=cos(\AngleQ);}
       \tikzmath{\sinq=sin(\AngleQ);}
       
       %Determinants (Cramer)
       %\tikzmath{\det=\cosp*\sinq-\cosq*\sinp;}
       \tikzmath{\det=sin(\AngleQ-\AngleP);}
       
       \tikzmath{\detx=\sinq-\sinp;}
       \tikzmath{\dety=\cosp-\cosq;}
       
       \tikzmath{\x=\R*\detx/\det;}
       \tikzmath{\y=\R*\dety/\det;}
       
       \coordinate (F) at (\x,\y);
       
       \filldraw (F) circle(2pt) node[above] {$F$};
       
       \draw ($(P)+(tp)$) -- ($(P)!1.25!(F)$);
       \draw ($(Q)+(tq)$) -- ($(Q)!1.25!(F)$);
       
   \end{tikzpicture}
\end{document}

Messages:
0 secs.