Trekantens medianer – trinvis.
Trekantens medianer skæres i et punkt. Medianen er den linje, der forbinder et hjørne med midtpunktet af den modstående side. Du kan flytte trekantens hjørner, A, B og C, med musen. Læg mærke til, at de tre medianer altid har et fælles punkt, P.
Figure figure = Position [0,0] Size[x,y*5/6] 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,-1] Free Size 2.5 Color "red";
Point B = [5,-2] Free Size 2.5 Color "red";
Point C = [0,3] 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 ab = Start A Dir B-A Size 1 Color "black";
Line bc = Start B Dir C-B Size 1 Color "black";
Line ca = Start C Dir A-C Size 1 Color "black";
State state = From 0 To 3 Initial 0;
PushButton next = Text "Næste" Action incr state Position [20,50] Size [60,30];
PushButton resetbutton = Text "Forfra" Action reset state Position [20,10] Size [60,30];
Visibility vis0 = (state == 0);
Text t0 = "Lad os betragte en vilkårlig trekant." Offset [20, y-20] Color "black";
Visibility vis1 = (state == 1);
Text t1 = "Her er en median." Offset [20, y-20] Color "black";
Visibility vis2 = (state == 2);
Text t2 = "Den skærer selvfølgelig den anden median." Offset [20, y-20] Color "black";
Visibility vis3 = (state == 3);
Text t3 = "Og den tredje går gennem skæringspunktet." Offset [20, y-20] Color "black";
Visibility vis0_ = (state > 0);
Line ma = Start A Dir (B+C)/2-A Size 1 Color "blue";
Visibility vis1_ = (state > 1);
Line mb = Start B Dir (A+C)/2-B Size 1 Color "blue";
Visibility vis2_ = (state > 2);
Line mc = Start C Dir (B+A)/2-C Size 1 Color "blue";