Tikz: Perpendicular FROM a lineRotate a node but not its content: the case of the ellipse...

What does "don't have a baby" imply or mean in this sentence?

Is there any way to play D&D without a DM?

What is an explicit bijection in combinatorics?

How to transport 10,000 terrestrial trolls across ocean fast?

Are all power cords made equal?

Why does a single AND gate need 60 transistors?

Why does this quiz question say that protons and electrons do not combine to form neutrons?

Does an enchantment ability that gives -1/-1 to opponent creatures resolve before other abilities can be used on a 1/1 entering the battlefield

Why do single electrical receptacles exist?

Is the UK legally prevented from having another referendum on Brexit?

Can't figure out a htaccess rule

Is Developer Console going to be deprecated?

Was the Spartan by Mimic Systems a real product?

1990s-2000s horror alien movie with slugs infecting people through the mouth

Converting numbers to words - Python

Is it possible to narrate a novel in a faux-historical style without alienating the reader?

Create a line break in a subscript-position term

In a post apocalypse world, with no power and few survivors, would Satnav still work?

What is an efficient way to digitize a family photo collection?

How can guns be countered by melee combat without raw-ability or exceptional explanations?

Does Plato's "Ring of Gyges" have a corrupting influence on its wearer?

Why would you use 2 alternate layout buttons instead of 1, when only one can be selected at once

Did ancient Germans take pride in leaving the land untouched?

What does an unprocessed RAW file look like?



Tikz: Perpendicular FROM a line


Rotate a node but not its content: the case of the ellipse decorationIntersection of paths with constructed namesHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?Why do I get an extra white page before my TikZ picture?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?Using tikz Calc package to add cordinates













4















With tikz-pgf, I can draw a perpendicular from a point to a line. Is there a robust method to draw a perpendicular from a point? For example, in the following code, say I want to raise a perpendicular, from a specific point on line BC outwards.



documentclass[tikz,border=10pt]{standalone}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}
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) {};
end{tikzpicture}
end{document}


enter image description here










share|improve this question

























  • You changed the position of the starting point in your question : so to draw from a point P on BC you can use (P) -- ++({2/sqrt(13)},{3/sqrt(13)}) (or to for faster compile (P) -- ++(0.5547001962252291,0.8320502943378437)), or you can use as I said calc to draw (P) -- ($(P)!1cm!90:(C)$).

    – Kpym
    55 mins ago











  • @Kpym I edited it because in the given form the suggested approach was obvious. I am looking for a general solution.

    – blackened
    54 mins ago











  • Hmm! I was being a fool, again. Say the point on BC is the midpoint. I can simply define that coordinate as, say, coordinate (P) at ($(B)!0.5!(C)$). Then I can do, draw (P)--($(P)!0.5!90:(C)$).

    – blackened
    39 mins ago











  • @blackened or draw[red, thick] (P) -- ($(A)!(P)!(C)$); as you already did for your line from B.

    – CarLaTeX
    29 mins ago
















4















With tikz-pgf, I can draw a perpendicular from a point to a line. Is there a robust method to draw a perpendicular from a point? For example, in the following code, say I want to raise a perpendicular, from a specific point on line BC outwards.



documentclass[tikz,border=10pt]{standalone}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}
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) {};
end{tikzpicture}
end{document}


enter image description here










share|improve this question

























  • You changed the position of the starting point in your question : so to draw from a point P on BC you can use (P) -- ++({2/sqrt(13)},{3/sqrt(13)}) (or to for faster compile (P) -- ++(0.5547001962252291,0.8320502943378437)), or you can use as I said calc to draw (P) -- ($(P)!1cm!90:(C)$).

    – Kpym
    55 mins ago











  • @Kpym I edited it because in the given form the suggested approach was obvious. I am looking for a general solution.

    – blackened
    54 mins ago











  • Hmm! I was being a fool, again. Say the point on BC is the midpoint. I can simply define that coordinate as, say, coordinate (P) at ($(B)!0.5!(C)$). Then I can do, draw (P)--($(P)!0.5!90:(C)$).

    – blackened
    39 mins ago











  • @blackened or draw[red, thick] (P) -- ($(A)!(P)!(C)$); as you already did for your line from B.

    – CarLaTeX
    29 mins ago














4












4








4


0






With tikz-pgf, I can draw a perpendicular from a point to a line. Is there a robust method to draw a perpendicular from a point? For example, in the following code, say I want to raise a perpendicular, from a specific point on line BC outwards.



documentclass[tikz,border=10pt]{standalone}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}
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) {};
end{tikzpicture}
end{document}


enter image description here










share|improve this question
















With tikz-pgf, I can draw a perpendicular from a point to a line. Is there a robust method to draw a perpendicular from a point? For example, in the following code, say I want to raise a perpendicular, from a specific point on line BC outwards.



documentclass[tikz,border=10pt]{standalone}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}
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) {};
end{tikzpicture}
end{document}


enter image description here







tikz-pgf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago







blackened

















asked 1 hour ago









blackenedblackened

1,498714




1,498714













  • You changed the position of the starting point in your question : so to draw from a point P on BC you can use (P) -- ++({2/sqrt(13)},{3/sqrt(13)}) (or to for faster compile (P) -- ++(0.5547001962252291,0.8320502943378437)), or you can use as I said calc to draw (P) -- ($(P)!1cm!90:(C)$).

    – Kpym
    55 mins ago











  • @Kpym I edited it because in the given form the suggested approach was obvious. I am looking for a general solution.

    – blackened
    54 mins ago











  • Hmm! I was being a fool, again. Say the point on BC is the midpoint. I can simply define that coordinate as, say, coordinate (P) at ($(B)!0.5!(C)$). Then I can do, draw (P)--($(P)!0.5!90:(C)$).

    – blackened
    39 mins ago











  • @blackened or draw[red, thick] (P) -- ($(A)!(P)!(C)$); as you already did for your line from B.

    – CarLaTeX
    29 mins ago



















  • You changed the position of the starting point in your question : so to draw from a point P on BC you can use (P) -- ++({2/sqrt(13)},{3/sqrt(13)}) (or to for faster compile (P) -- ++(0.5547001962252291,0.8320502943378437)), or you can use as I said calc to draw (P) -- ($(P)!1cm!90:(C)$).

    – Kpym
    55 mins ago











  • @Kpym I edited it because in the given form the suggested approach was obvious. I am looking for a general solution.

    – blackened
    54 mins ago











  • Hmm! I was being a fool, again. Say the point on BC is the midpoint. I can simply define that coordinate as, say, coordinate (P) at ($(B)!0.5!(C)$). Then I can do, draw (P)--($(P)!0.5!90:(C)$).

    – blackened
    39 mins ago











  • @blackened or draw[red, thick] (P) -- ($(A)!(P)!(C)$); as you already did for your line from B.

    – CarLaTeX
    29 mins ago

















You changed the position of the starting point in your question : so to draw from a point P on BC you can use (P) -- ++({2/sqrt(13)},{3/sqrt(13)}) (or to for faster compile (P) -- ++(0.5547001962252291,0.8320502943378437)), or you can use as I said calc to draw (P) -- ($(P)!1cm!90:(C)$).

– Kpym
55 mins ago





You changed the position of the starting point in your question : so to draw from a point P on BC you can use (P) -- ++({2/sqrt(13)},{3/sqrt(13)}) (or to for faster compile (P) -- ++(0.5547001962252291,0.8320502943378437)), or you can use as I said calc to draw (P) -- ($(P)!1cm!90:(C)$).

– Kpym
55 mins ago













@Kpym I edited it because in the given form the suggested approach was obvious. I am looking for a general solution.

– blackened
54 mins ago





@Kpym I edited it because in the given form the suggested approach was obvious. I am looking for a general solution.

– blackened
54 mins ago













Hmm! I was being a fool, again. Say the point on BC is the midpoint. I can simply define that coordinate as, say, coordinate (P) at ($(B)!0.5!(C)$). Then I can do, draw (P)--($(P)!0.5!90:(C)$).

– blackened
39 mins ago





Hmm! I was being a fool, again. Say the point on BC is the midpoint. I can simply define that coordinate as, say, coordinate (P) at ($(B)!0.5!(C)$). Then I can do, draw (P)--($(P)!0.5!90:(C)$).

– blackened
39 mins ago













@blackened or draw[red, thick] (P) -- ($(A)!(P)!(C)$); as you already did for your line from B.

– CarLaTeX
29 mins ago





@blackened or draw[red, thick] (P) -- ($(A)!(P)!(C)$); as you already did for your line from B.

– CarLaTeX
29 mins ago










3 Answers
3






active

oldest

votes


















3














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






share|improve this answer































    2














    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






    share|improve this answer


























    • Good, please could you decrease the velocity of the animation :-)?

      – Sebastiano
      23 mins ago



















    0














    Answer to the first version of the question



    With intersections you can give a name to your triangle path, then build a "fake path" from (4,0) to a point after the intersection with the triangle (you don't need to calculate it exactly, see name path=riga and draw it to understand what I'm saying) and name it, then you can draw a line between the intersections with your triangle and your "fake path".



    Answer to the second version of the question



    If you want to start from a point on BC, you can use coordinate (P) at ($(B)!.5!(C)$); with any value you want instead of .5 and do like you did for the line from B (see the thick red line in my MWE).



    documentclass[tikz,border=10pt]{standalone}
    usetikzlibrary{calc, intersections}
    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[name path=trian](A) --(B)--(C)--cycle;
    draw[red] (B) -- ($(A)!(B)!(C)$);
    path [name path=riga] (4,0) -- ++(0,3);
    path [name intersections={of=trian and riga}];
    draw (intersection-1) -- (intersection-2);
    coordinate (P) at ($(B)!.5!(C)$);
    draw[red, thick] (P) -- ($(A)!(P)!(C)$);
    end{tikzpicture}
    end{document}


    enter image description here






    share|improve this answer


























    • I understood the question as OP want a line starting from som point on BC and going perpendicular to BC outward some distance. (ok now I see that the question has been edited).

      – hpekristiansen
      55 mins ago













    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476296%2ftikz-perpendicular-from-a-line%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    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






    share|improve this answer




























      3














      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






      share|improve this answer


























        3












        3








        3







        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






        share|improve this answer













        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







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 39 mins ago









        ZarkoZarko

        125k867164




        125k867164























            2














            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






            share|improve this answer


























            • Good, please could you decrease the velocity of the animation :-)?

              – Sebastiano
              23 mins ago
















            2














            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






            share|improve this answer


























            • Good, please could you decrease the velocity of the animation :-)?

              – Sebastiano
              23 mins ago














            2












            2








            2







            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






            share|improve this answer















            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







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 11 secs ago

























            answered 39 mins ago









            chishimutojichishimutoji

            7441320




            7441320













            • Good, please could you decrease the velocity of the animation :-)?

              – Sebastiano
              23 mins ago



















            • Good, please could you decrease the velocity of the animation :-)?

              – Sebastiano
              23 mins ago

















            Good, please could you decrease the velocity of the animation :-)?

            – Sebastiano
            23 mins ago





            Good, please could you decrease the velocity of the animation :-)?

            – Sebastiano
            23 mins ago











            0














            Answer to the first version of the question



            With intersections you can give a name to your triangle path, then build a "fake path" from (4,0) to a point after the intersection with the triangle (you don't need to calculate it exactly, see name path=riga and draw it to understand what I'm saying) and name it, then you can draw a line between the intersections with your triangle and your "fake path".



            Answer to the second version of the question



            If you want to start from a point on BC, you can use coordinate (P) at ($(B)!.5!(C)$); with any value you want instead of .5 and do like you did for the line from B (see the thick red line in my MWE).



            documentclass[tikz,border=10pt]{standalone}
            usetikzlibrary{calc, intersections}
            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[name path=trian](A) --(B)--(C)--cycle;
            draw[red] (B) -- ($(A)!(B)!(C)$);
            path [name path=riga] (4,0) -- ++(0,3);
            path [name intersections={of=trian and riga}];
            draw (intersection-1) -- (intersection-2);
            coordinate (P) at ($(B)!.5!(C)$);
            draw[red, thick] (P) -- ($(A)!(P)!(C)$);
            end{tikzpicture}
            end{document}


            enter image description here






            share|improve this answer


























            • I understood the question as OP want a line starting from som point on BC and going perpendicular to BC outward some distance. (ok now I see that the question has been edited).

              – hpekristiansen
              55 mins ago


















            0














            Answer to the first version of the question



            With intersections you can give a name to your triangle path, then build a "fake path" from (4,0) to a point after the intersection with the triangle (you don't need to calculate it exactly, see name path=riga and draw it to understand what I'm saying) and name it, then you can draw a line between the intersections with your triangle and your "fake path".



            Answer to the second version of the question



            If you want to start from a point on BC, you can use coordinate (P) at ($(B)!.5!(C)$); with any value you want instead of .5 and do like you did for the line from B (see the thick red line in my MWE).



            documentclass[tikz,border=10pt]{standalone}
            usetikzlibrary{calc, intersections}
            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[name path=trian](A) --(B)--(C)--cycle;
            draw[red] (B) -- ($(A)!(B)!(C)$);
            path [name path=riga] (4,0) -- ++(0,3);
            path [name intersections={of=trian and riga}];
            draw (intersection-1) -- (intersection-2);
            coordinate (P) at ($(B)!.5!(C)$);
            draw[red, thick] (P) -- ($(A)!(P)!(C)$);
            end{tikzpicture}
            end{document}


            enter image description here






            share|improve this answer


























            • I understood the question as OP want a line starting from som point on BC and going perpendicular to BC outward some distance. (ok now I see that the question has been edited).

              – hpekristiansen
              55 mins ago
















            0












            0








            0







            Answer to the first version of the question



            With intersections you can give a name to your triangle path, then build a "fake path" from (4,0) to a point after the intersection with the triangle (you don't need to calculate it exactly, see name path=riga and draw it to understand what I'm saying) and name it, then you can draw a line between the intersections with your triangle and your "fake path".



            Answer to the second version of the question



            If you want to start from a point on BC, you can use coordinate (P) at ($(B)!.5!(C)$); with any value you want instead of .5 and do like you did for the line from B (see the thick red line in my MWE).



            documentclass[tikz,border=10pt]{standalone}
            usetikzlibrary{calc, intersections}
            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[name path=trian](A) --(B)--(C)--cycle;
            draw[red] (B) -- ($(A)!(B)!(C)$);
            path [name path=riga] (4,0) -- ++(0,3);
            path [name intersections={of=trian and riga}];
            draw (intersection-1) -- (intersection-2);
            coordinate (P) at ($(B)!.5!(C)$);
            draw[red, thick] (P) -- ($(A)!(P)!(C)$);
            end{tikzpicture}
            end{document}


            enter image description here






            share|improve this answer















            Answer to the first version of the question



            With intersections you can give a name to your triangle path, then build a "fake path" from (4,0) to a point after the intersection with the triangle (you don't need to calculate it exactly, see name path=riga and draw it to understand what I'm saying) and name it, then you can draw a line between the intersections with your triangle and your "fake path".



            Answer to the second version of the question



            If you want to start from a point on BC, you can use coordinate (P) at ($(B)!.5!(C)$); with any value you want instead of .5 and do like you did for the line from B (see the thick red line in my MWE).



            documentclass[tikz,border=10pt]{standalone}
            usetikzlibrary{calc, intersections}
            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[name path=trian](A) --(B)--(C)--cycle;
            draw[red] (B) -- ($(A)!(B)!(C)$);
            path [name path=riga] (4,0) -- ++(0,3);
            path [name intersections={of=trian and riga}];
            draw (intersection-1) -- (intersection-2);
            coordinate (P) at ($(B)!.5!(C)$);
            draw[red, thick] (P) -- ($(A)!(P)!(C)$);
            end{tikzpicture}
            end{document}


            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 6 mins ago

























            answered 1 hour ago









            CarLaTeXCarLaTeX

            31.8k551133




            31.8k551133













            • I understood the question as OP want a line starting from som point on BC and going perpendicular to BC outward some distance. (ok now I see that the question has been edited).

              – hpekristiansen
              55 mins ago





















            • I understood the question as OP want a line starting from som point on BC and going perpendicular to BC outward some distance. (ok now I see that the question has been edited).

              – hpekristiansen
              55 mins ago



















            I understood the question as OP want a line starting from som point on BC and going perpendicular to BC outward some distance. (ok now I see that the question has been edited).

            – hpekristiansen
            55 mins ago







            I understood the question as OP want a line starting from som point on BC and going perpendicular to BC outward some distance. (ok now I see that the question has been edited).

            – hpekristiansen
            55 mins ago




















            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476296%2ftikz-perpendicular-from-a-line%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Szabolcs (Ungheria) Altri progetti | Menu di navigazione48°10′14.56″N 21°29′33.14″E /...

            Discografia di Klaus Schulze Indice Album in studio | Album dal vivo | Singoli | Antologie | Colonne...

            How to make inet_server_addr() return localhost in spite of ::1/128RETURN NEXT in Postgres FunctionConnect to...