Ellipser.
Du kan variere parametrene a og b. For a = b fås en cirkel. Excentriciteten, e, som ligger mellem 0 og 1, er et mål for, hvor "fladtrykt" ellipsen er.
Figure figure = Position [0,0] Size[x,y*13/16] Origin[x/2,y*7/16] Unit x/11 Color "white";
Axes axes = Color "black";
Grid grid = Color "blue";
Units units = Color "black";
SlidePot a = From 1.5 To 5 Initial 2 Position [20,y-50] Size [180,0];
SlidePot b = From 0.1 To 1.5 Initial 1 Position [20,y-20] Size [180,0];
Text a_txt = "a = a,2" Offset [220,y-45] Color "blue";
Text b_txt = "b = b,2" Offset [220,y-15] Color "blue";
Variable exc = sqrt(1-(b/a)^2);
Tex formula1 = "\\large{\\frac{x^2}{a^2} + \\frac{y^2}{b^2} = 1}" Offset [340,y-72] Color "black";
Tex formula2 = "e = \\sqrt{ 1 - \\large{(\\frac{b}{a})^2}} =" Offset [340,y-35] Color "black";
Text formula3 = "exc,2" Offset [490,y-10] Color "black" Style "font-size:120%;";
Graph gr1 = b * sqrt( 1 - (x/a)^2 ) Size 1.5 Color "red";
Graph gr2 = -b * sqrt( 1 - (x/a)^2 ) Size 1.5 Color "red";
Point p1 = [exc*a,0] Size 2.5 Color "red";
Point p2 = [-exc*a,0] Size 2.5 Color "red";