Linjer (2).
Figuren viser linjen med ligningen: ax + by + c = 0. Du kan variere parametrene a, b og c. Læg mærke til linjens normalvektor (a,b), som er indtegnet med rødt.
Figure figure = Position [0,0] Size[x,y*13/16] Origin[x/3,y*7/16] Unit x/12 Color "white";
Axes axes = Color "black";
Grid grid = Color "blue";
Units units = Color "black";
SlidePot a = From -4 To 4 Initial 1 Position [20,y-60] Size [150,0];
SlidePot b = From -4 To 4 Initial 1 Position [20,y-40] Size [150,0];
SlidePot c = From -4 To 4 Initial 1 Position [20,y-20] Size [150,0];
Text a_txt = "a = a,2" Offset [190,y-55] Color "blue";
Text b_txt = "b = b,2" Offset [190,y-35] Color "blue";
Text c_txt = "c = c,2" Offset [190,y-15] Color "blue";
Variable x0 = -c/a;
Variable y0 = -c/b;
Text descr11 = "Linje med ligningen:" Offset [300,y-55] Color "black";
Tex descr12 = "ax + by + c = 0" Offset [450,y-69] Color "black";
Visibility visa = ( a != 0 );
Text descr2 = "Skærer x-aksen i " Offset [300,y-35] Color "black";
Text descr21 = "x = x0,2" Offset [430,y-35] Color "black" Style "font-family:MJX_MATH;font-size:120%;";
Visibility visb = ( b != 0 );
Text descr3 = "Skærer y-aksen i " Offset [300,y-15] Color "black";
Text descr30 = "y = y0,2" Offset [430,y-15] Color "black" Style "font-family:MJX_MATH;font-size:120%;";
Visibility visab = ( a != 0 ) | ( b != 0 );
Line line = Start if a != 0 then [-c/a,0] else [0,-c/b] endif Dir [a,b]^ Infinite Size 1 Color "blue";
Line norm = Start [0,0] Dir [a,b] Vector Size 1 Color "red";