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

$\LaTeX$ V: TikZ
Quando eu dou de comer aos pobres
Me chamam de santo
Quando eu pergunto por que eles são pobres
Me chamam de comunista
Dom Helder Câmera

Points and Coordnates

  1. \coordinate (A) at (1,2);
    \coordinate (B) at (-3,1);
    \coordinate (C) at (2,-3);
  2. Synonimous: \path...
  3. Linear Combinations:
    \coordinate (D) at ($1/3*(A)+1/3*(B)+1/3*(C)$);
  4. Convex Combinations: \[ \overrightarrow{OC}= (1-t)\overrightarrow{OA} +t\overrightarrow{OB} \]
    \tikzmath{\t=-1;}
    \coordinate (C) at ($(A)!\t!(B)$);
  5. Polar Coordinates:
    \tikzmath{\Angle=60;}
    \tikzmath{\R=2;}
    \coordinate (P) at (\Angle:\R);

    Angles in degrees!
  6. Projection Ortogonal of $C$ on Segment $AB$:
    \coordinate (P) at ($(A)!(C)!(B)$);

    Angles in degrees!
  7. Relative coordinates:
    \draw[-latex] (A) --+(v);
  8. Retrieve coordinates (in TikZ preamble):
    LaTeX Listing: h.tex. PDF   ZIP*  
    \documentclass{article}
    %%..
    %%Usage: \gettikzxy{(P)}{\px}{\py}
    \makeatletter
    \newcommand{\gettikzxy}[3]{%
      \tikz@scan@one@point\pgfutil@firstofone#1\relax
      \edef#2{\the\pgf@x}%
      \edef#3{\the\pgf@y}%
      \tikzmath{\#2=#2/28.3465;};
      \tikzmath{\#3=#3/28.3465;};
    }
    \makeatother
    %%..
    \begin{document}
     
    %%..
    
    \begin{tikzpicture}
       \coordinate (A) at (1,1);
       \coordinate (B) at (3,4);
       \coordinate (M) at ($(A)!0.5!(B)$);
       
       \gettizxy{(A)}{\ax}{\ay};
       \gettizxy{(B)}{\bx}{\by};
       \gettizxy{(M)}{\mx}{\my};
       
       \node at (A) {$A=(\ax,\ay)$};
       \node at (B) {$B=(\bx,\by)$};
       \node at (M) {$M=(\mx,\my)$};
    \end{tikzpicture}
     
    %%..
    \end{document}
    

Messages:
0 secs.