Trekantens højder skæres i et punkt. Højden er en linje gennem et hjørne, som er vinkelret på den modstående side. Du kan flytte trekantens hjørner, A, B og C, med musen. Læg mærke til, at de tre højder altid har et fælles punkt, P.
Figure figure = Position [0,0] Size[x,y] Origin[x/3,y/2] Unit x/12 Color "white";
//Axes axes = Color "black";
//Grid grid = Color "blue";
//Units units = Color "black";
Point A = [-2,-2] Free Size 2.5 Color "red";
Point B = [5,-2] Free Size 2.5 Color "red";
Point C = [0,2] Free Size 2.5 Color "red";
Label laba = "A" At A Offset [10,-5] Color "black";
Label labb = "B" At B Offset [10,-5] Color "black";
Label labc = "C" At C Offset [10,-5] Color "black";
Line ab1 = Start A Dir B-A Infinite Size 1 Color "gray";
Line bc1 = Start B Dir C-B Infinite Size 1 Color "gray";
Line ca1 = Start C Dir A-C Infinite Size 1 Color "gray";
Line ab = Start A Dir B-A Size 1.5 Color "black";
Line bc = Start B Dir C-B Size 1.5 Color "black";
Line ca = Start C Dir A-C Size 1.5 Color "black";
Variable haf = project(A,B,C);
Line ha1 = Start A Dir haf-A Infinite Size 1 Color "lightblue";
Line ha = Start A Dir haf-A Size 1.5 Color "blue";
Variable rema = if length(B-haf) > length(C-haf) then B else C endif;
RightAngle ra = At haf From angle(A-haf) To angle(rema-haf) Size 0.3 Color "black";
Variable hbf = project(B,A,C);
Line hb1 = Start B Dir hbf-B Infinite Size 1 Color "lightblue";
Line hb = Start B Dir hbf-B Size 1.5 Color "blue";
Variable remb = if length(A-hbf) > length(C-hbf) then A else C endif;
RightAngle rb = At hbf From angle(B-hbf) To angle(remb-hbf) Size 0.3 Color "black";
Variable hcf = project(C,B,A);
Line hc1 = Start C Dir hcf-C Infinite Size 1 Color "lightblue";
Line hc = Start C Dir hcf-C Size 1.5 Color "blue";
Variable remc = if length(A-hcf) > length(B-hcf) then A else B endif;
RightAngle rc = At hcf From angle(C-hcf) To angle(remc-hcf) Size 0.3 Color "black";
Point P = intersect(A,haf,B,hbf) Size 2.5 Color "blue";
Label labp = "P" At P Offset [10,-5] Color "black";