Tikz: Perpendicular FROM a line

if you willing to define specific point on line (B)--(C) with its relative position, than you can write your mwe as following simple solution:

\documentclass[tikz,border=10pt]{standalone}

\begin{document}
\begin{tikzpicture}
    \coordinate[label=below left:$A$]   (A) at (0,0);
    \coordinate[label=above:$B$]        (B) at (2,4);
    \coordinate[label=below right:$C$]  (C) at (8,0);

    \draw(A)--(B)-- coordinate[pos=0.3] (aux) % <--- coordinate of the point
                    (C)--cycle;
    \draw[red] (aux) -- (aux |- A);
\end{tikzpicture}
\end{document}

enter image description here


I just wrote such a style in this answer. I slightly changed the syntax, so you need to say

\draw[blue,vert={of {(B)--(C)} at (3,0)}];

to draw a vertical line at (3,0) that goes all the way until it hits BC. And I added vert outwards which is just a wrapper of the distance modifiers (see section 13.5.4 The Syntax of Distance Modifiers of the pgfmanual), and can be used as

    \draw[blue,vert outwards={from {($(B)!0.3!(C)$)} by 3cm on line to {(C)}}];

MWE

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[vert/.style args={of #1 at #2}{insert path={%
#2 -- (intersection cs:first
  line={#1}, second line={#2--($#2+(0,10)$)}) }},
vert outwards/.style args={from #1 by #2 on line to #3}{insert path={
#1 -- ($#1!#2!90:#3$)
}}]
    \coordinate (A) at (0,0);
    \coordinate (B) at (2,4);
    \coordinate (C) at (8,0);

    \draw(A)--(B)--(C)--cycle;
    \draw[red] (B) -- ($(A)!(B)!(C)$);

    \node[label={below left:$A$}] at (A) {};
    \node[label={above:$B$}] at (B) {};
    \node[label={below right:$C$}] at (C) {};
    \draw[blue,vert={of {(B)--(C)} at (3,0)}];
    \draw[blue,vert outwards={from {($(B)!0.3!(C)$)} by 3cm on line to {(C)}}];
\end{tikzpicture}
\end{document}

enter image description here


Sorry, not tikz. I understand @hpekris's idea.

\documentclass[pstricks,border=10pt]{standalone}
\usepackage{pst-eucl}
\begin{document}
\foreach \i in {.3,.5,.7}{
\begin{pspicture}[PointSymbol=none,linejoin=1](0,-1)(8,4)
\pnodes(0,0){A}(2,4){B}(8,0){C}(4,0){I}
\psline(A)(B)(C)(A)
\pstHomO[HomCoef=\i,PosAngle=75]{B}{C}[M]
\pstProjection[PosAngle=-90]{A}{C}{B}[H]
\pstProjection[PosAngle=-90]{A}{C}{M}[M']
\pcline(M)(M')
\pcline(B)(H)
\end{pspicture}}
\end{document}

enter image description here

Tags:

Tikz Pgf