show that this equation 'ellipse'
[email protected],28/03/2017
ref:
http://staff.argyll.epsb.ca/jreed/math30p/conics/general.htm
(%i1) |
kill(all)$ load(eigen)$ |
given : parametric x=x(t)
y=y(t),k=constant
(%i3) |
p1:X=k*cos(t); p2:Y=-(k*sin(t)+k*cos(t))/2; |
(%i4) | p3:linsolve([p1, p2], [cos(t),sin(t)]); |
(%i6) |
p4:p3[1]; p5:p3[2]; |
(%i8) |
p6:(p3[1])^2; p7:(p3[2])^2; |
(%i9) | p8:(p6+p7); |
geometry: identity '(cos(theta))^2+(sin(theta))^2 = 1'
(%i10) | p9:trigrat(sin(t)^2+cos(t)^2=(2*Y+X)^2/k^2+X^2/k^2)*k^2; |
ref : A*x^2+B*X*Y+C*y^2+D*x+E*x+F = 0 (1)
(%i11) | p10:rhs(p9)-lhs(p9)=0; |
(%i18) |
p11:A=coeff(part(p10,1),X^2); p111:ratsubst(v,X*Y, part(p10,1)=0)$ p12:B=coeff(part(p111,1),v); p13:C=coeff(part(p10,1),Y^2); p14:D=ev(coeff(part(p10,1),X),Y=0); p15:E=ev(coeff(part(p10,1),Y),X=0); p16:F=ev(part(p10,1),X=0,Y=0); |
X*Y : rotation of the conic section.
-----------------------------------
see:ref = ' det = B^2-4*A*C ' (2)
-----------------------------------
see ' above (1) '
-----------------------------------
circle : A=C<>0 , det < 0
ellipse : A<>C , det < 0
parabola : , det = 0
hyperbola: , det > 0
-----------------------------------
-----------------------------------
(%i19) | p17:det=(part(p12,2))^2-4*(part(p11,2))*(part(p13,2)); |
programming : Maxima
rem : construction ' simple if '
(%i22) |
if part(p17,2)<0 and part(p11,2)=part(p13,2) then disp("circle") else disp("ellipse")$ if part(p17,2)> 0 then disp("hyperbola")$ if part(p17,2)= 0 then disp("parabola")$ |
# = not equal to
other :>,=,<,≥,≤
(%i23) |
if part(p12,2) # 0 then disp ("rotated conic ")$ |
rem : construction: if 'with elseif'
if ' condition ' then
output
elseif ' condition ' then output
elseif ' condition ' then output
else output
(%i24) | s:3; |
(%i25) |
if s < 0 then "minus" elseif s < 5 then "small" elseif s < 10 then "medium" else "large"; |
appendix: statement 'trigrat'