JAMET

375 Reputation

4 Badges

7 years, 321 days

MaplePrimes Activity


These are questions asked by JAMET

I would like to show : in a quadrilateral circumscribed to an ellipse, the line passing through the middle of the diagonals passes through the centre of the ellipse.
My code is :

restart; with(geometry): with(plots): `local`(O):
_EnvHorizontalName := x: _EnvVerticalName := y:

alias(coor = coordinates):
ell := x^2/a^2+y^2/b^2 = 1:
point(P1,a*cos(omega), b*sin(omega)):
point(P2,a*cos(omega-(1/2)*Pi), b*sin(omega-(1/2)*Pi)): 
point(P3,a*cos(omega+(8/7)*Pi), b*sin(omega+(8/7)*Pi)):
point(P4,a*cos(omega+5*Pi*(1/2)), b*sin(omega+5*Pi*(1/2))):
a := 5: b := 3: omega := (1/5)*Pi:
Ell := implicitplot(ell, x = -a .. a, y = -b .. b, color = red): 
dr := draw([seq(P || k, k = 1 .. 4)], axes = normal, printtext = true):

for i from 1 to 4 do tgP||i := x*coor(P||i)[1]/a^2+y*coor(P||i)[2]/b^2 = 1 od:
poly := Matrix([coor(P1), coor(P2), coor(P3), coor(P4)]):
Quadri := polygonplot(poly, axes = normal, color = "DarkGreen", transparency = .8):

with(combinat): with(ListTools):
L := [1, 2, 3, 4]:
for i from 1 to 4 do Rotate(L, i)[1] od:
for i to 4 do solve({(tgP || Rotate)(L, i)[1], tgP || i}, {x, y}); point(S || i, subs(%, x), subs(%, y)); coor(S || i) end do;
Error, invalid input: subs received 1, which is not valid for its 1st argument
#otherwise
solve({tgP1, tgP2}, {x, y}): point(S1, subs(%, x), subs(%, y)); coor(S1):
                               S1
solve({tgP2, tgP3}, {x, y}): point(S2, subs(%, x), subs(%, y)); coor(S2):
                               S2
solve({tgP3, tgP4}, {x, y}): point(S3, subs(%, x), subs(%, y)); coor(S3):
                               S3
solve({tgP1, tgP4}, {x, y}): point(S4, subs(%, x), subs(%, y)); coor(S4):
                               S4

poly := Matrix([coor(S1), coor(S2), coor(S3), coor(S4)]):
Quadri2 := polygonplot(poly, axes = normal, color = "DarkGreen", transparency = .9):
#dr2:=draw(seq(S||k,k =1..4), axes = normal, printtext = true):
line(diag13, [S1, S3]): line(diag24, [S2, S4]): midpoint(M1, S1, S3): midpoint(M2, S4, S2): 
line(Lm, [M1, M2]):
dr2 := draw([S1, S2, S3, S4, M1, M2, Lm(color = black), diag13, diag24], axes = normal, printtext = true):
for i from 1 to 4 do
TgP||i := implicitplot(tgP||i, x = -a-5 .. a+5, y = -b-5 .. b+5, color = blue) od:
display([Ell, seq(TgP||i,i=1..4), Quadri, Quadri2,dr,dr2], view = [-a-5 .. a+3, -b-2 .. b+2], 
scaling = constrained, size = [700, 700]); Thank you for your answere.

How to find the location of the poles of a normal chord in an ellipse ?
Here is my code :

restart; with(geometry); with(plots); `local`(O);
_EnvHorizontalName := x; _EnvVerticalName := y;
corde := a*x/cos(theta)-b*y/sin(theta) = a^2-b^2;
isolate(corde, a/cos(theta));
Error, (in isolate) a*x/cos(theta)-b*y/sin(theta) = a^2-b^2 does not contain a/cos(theta)
eq1 := (a^2-b^2)*X/a^2 = a/cos(theta);
c := solve(eq1, cos(theta));
eq2 := (a^2-b^2)*Y/b^2 = -b/sin(theta);
s := solve(eq2, sin(theta));
lieu := simplify(expand((a^2-b^2)^2*X^2*Y^2*(c^2+s^2 = 1)));
allvalues(eliminate({eq1, eq2}, theta))[1][2];
ell := x^2/a^2+y^2/b^2 = 1;
P := [a*cos(theta), b*sin(theta)];
tgP := x*P[1]/a^2+y*P[2]/b^2 = 1;

sol := solve({corde, ell}, {x, y});
tgP1 := simplify(x*rhs(sol[2][1])/a^2+y*rhs(sol[2][2])/b^2 = 1);

Drawing in a case
a := 5; b := 3; theta := (1/6)*Pi;

line(l1, corde); conic(co, ell);
Pole(P1, l1, co); coordinates(P1);
a := 5; b := 3; theta := (1/6)*Pi;
Ell := implicitplot(ell, x = -a .. a, y = -b .. b, color = red);
Cor := implicitplot(corde, x = -a-1 .. a, y = -b-1 .. b, color = blue);
TgP := implicitplot(tgP, x = 0 .. 10, y = -5 .. 10, color = magenta);
TgP1 := implicitplot(tgP1, x = -5 .. 10, y = -5 .. 10, color = magenta);
lieu := subs(X = x, Y = y, lieu);
subs(x = 125*sqrt(3)*(1/24), y = -27/8, lieu);
Lieu := implicitplot(lieu, x = -a .. a, y = -b .. b, color = green);
dr := draw(P1);
display([Ell, Cor, Lieu, TgP, TgP1, dr], axes = normal, view = [-10 .. 10, -10 .. 10], scaling = constrained);

Why the drawin of the location (lieu) does not appear ? Thank you.

I am solving this question :the line joining the ends of 2 rectangular diameters of an ellipse, remains tangent to a fixed circumference. My code is :

restart; with(geometry); with(plots); unprotect(O);
_EnvHorizontalName := x; _EnvVerticalName := y;
ell := x^2/a^2+y^2/b^2 = 1;
a := 5; b := 3; alpha := (1/6)*Pi; p := sqrt(a^2*b^2/(a^2+b^2));
PQ := x*cos(alpha)+y*sin(alpha)-p; drPQ := solve(PQ, y);
OPQ := x^2/a^2+y^2/b^2-((x*cos(alpha)+y*sin(alpha))/p)^2;
sol := solve({OPQ, ell}, {x, y}, explicit); P := [subs(sol[1], x), subs(sol[1], y)]; Q := [subs(sol[3], x), subs(sol[3], y)];
O := [0, 0];
Ell := implicitplot(ell, x = -a .. a, y = -b .. b, color = red);
DrOPQ := implicitplot(OPQ, x = -a .. a, y = -b .. b, color = magenta, numpoints = 5000);
DrPQ := plot(drPQ, x = -6 .. 6, color = green);
line(OP, 2*x-y); line(OQ, -(1/2)*x-y);

Points := pointplot([O[],P[],Q[]], symbol = solidcircle, color = red, symbolsize = 10):

T := textplot([[O[], "O"],[P[],"P"],[Q[],"Q"]], font = [times, 15], align = {below, right}):
cir := x^2+y^2 = p^2;
Cir := implicitplot(cir, x = -a .. a, y = -b .. b, color = black);
display([Ell, Cir, DrPQ, DrOPQ, Points, T], view = [-6 .. 6, -4 .. 6], axes = normal, scaling = constrained);
Fig := proc (k) local alpha, PQ, drPQ, DrPQ, OPQ, DrOPQ, sol, P, Q, Points, T; global a, b, p, ell, Ell, Cir; alpha := k; PQ := x*cos(alpha)+y*sin(alpha)+p; drPQ := solve(PQ, y); OPQ := x^2/a^2+y^2/b^2-(x*cos(alpha)+y*sin(alpha))^2/p^2; sol := solve({ell, OPQ}, {x, y}, explicit); P := [subs(sol[1], x), subs(sol[1], y)]; Q := [subs(sol[3], x), subs(sol[3], y)]; Points := pointplot([P[], Q[]], symbol = solidcircle, color = red, symbolsize = 10);
T := textplot([[P[], "P"], [Q[], "Q"]], font = [times, 15], align = {below, right}); DrPQ := plot(drPQ, x = -6 .. 6, color = green);µ DrOPQ := implicitplot(OPQ, x = -a .. a, y = -b .. b, color = magenta, numpoints = 5000);
display([Ell, Cir, DrPQ, DrOPQ, Points, T], view = [-a .. a, -b .. b], axes = normal, scaling = constrained) end proc;

Fig((1/4)*Pi);
Error, (in Fig) invalid subscript selector
nframes := 100; plots:-display([seq(Fig(2*Pi*i/nframes), i = 0 .. nframes)], insequence, scaling = constrained);
Error, (in Fig) invalid subscript selector
Explore(Fig(n), n = 0 .. 2*Pi);
Thank you for your help.

We give a line (D) and a point A located at a distance AH=h from D. A constant angle of magnitude alpha pivots to its apex A and we call B and C the points where its sides cut the line D. Let O be the center of the circle circumscribed to the triangle ABC.
Demonstrate that the B and C tangents to the O circle keep a fixed direction. 
Here is my code which don't work for slopes are not equal.

restart; with(plots): with(geometry):unprotect(D):
_EnvHorizontalName := 'x':_EnvVerticalName := 'y':
line(D, y = (1/2)*x-1); point(A, 5, 5); PerpendicularLine(lp, A, D); h := distance(A, D); intersection(H, D, lp);
alpha := (1/16)*Pi;
rotation(lp1, lp, (1/6)*Pi, 'clockwise', A); rotation(lp2, lp1, (1/6)*Pi-alpha, 'clockwise', A); FindAngle(lp1, lp2); evalf(%);
intersection(B, D, lp1); intersection(C, D, lp2);
triangle(T, [A, B, C]);
circumcircle(Elc, T, 'centername' = OO);
TangentLine(tgB, B, Elc); TangentLine(tgC, C, Elc);
evalf(slope(tgB)); evalf(slope(tgC));
dr := draw([D(color = blue), lp(color = red), Elc(color = green), A, B, C, T(color = black), H, tgB, tgC], printtext = true);

display([dr], axes = none, scaling = constrained);
Fig := proc (k) local dr, Elc, B, C, lp1, lp2; global D, A, lp, H, alpha; geometry:-rotation(lp1, lp, (1/6)*Pi+k, 'clockwise', A); geometry:-rotation(lp2, lp1, (1/6)*Pi-alpha+k, 'clockwise', A); geometry:-intersection(B, D, lp1); geometry:-intersection(C, D, lp2); geometry:-triangle(T, [A, B, C]); geometry:-circumcircle(Elc, T, 'centername' = OO); geometry:-TangentLine(tgB, B, Elc); geometry:-TangentLine(tgC, C, Elc); dr := geometry:-draw([D(color = blue), lp(color = red), Elc(color = green), A, B, C, T(color = black), H, tgB, tgC], printtext = true); plots:-display([dr], axes = none, scaling = constrained) end proc;
iframes := 10;

display([seq(Fig((1/12)*Pi+i/(10*iframes)), i = 1 .. iframes)], insequence, scaling = constrained);
How to improve this code ? Thank you.

Is it possible to write an equation reduction program that uses only LinearAlgebra.?

restart; with(LinearAlgebra); with(Student[LinearAlgebra]); unprotect(D);
f := proc (x, y) options operator, arrow; 5*x^2+4*y*x+8*y^2+16*x-8*y-16 end proc;
A := coeff(f(x, y), x, 2); B := coeff(coeff(f(x, y), x, 1), y, 1); C := coeff(f(x, y), y, 2); D := coeff(coeff(f(x, y), x, 1), y, 0); E := coeff(coeff(f(x, y), y, 1), x, 0);
F := tcoeff(f(x, y));
MQ:=Matrix([[A,B/2], [B/2,C]]):
Delta := A^2-4*A*C;
ML := `<,>`(D, E);
vp := Eigenvalues(MQ);
Omega := evalm(-`&*`((1/2)*ML, 1/MQ));
M1 := MQ-Eigenvalues(MQ)[1]*IdentityMatrix(2);
M2 := MQ-Eigenvalues(MQ)[2]*IdentityMatrix(2);
D := JordanForm(MQ);
with(linalg);
ma := matrix(2, 2, [A, (1/2)*B, (1/2)*B, C]);
jordan(ma, 'P1'); G := map(normalize, GramSchmidt([col(P1, 1 .. 2)])); P := map(simplify, concat(op(G)));

;
evalm(`&*`(`&*`(1/P, MQ), P));
nx := [X, Y];
var := [x, y];
x := matrix([seq([nx[i]], i = 1 .. 2)]); y := evalm(`&*`(P, x));
s := seq(var[k] = y[k, 1]+Omega[k], k = 1 .. 2);
eq := unapply(simplify(expand(subs(s, f(x, y)))), X, Y);
alpha := -eq(0, 0);
a := sqrt(alpha/vp[2]); b := sqrt(alpha/vp[1]); c := sqrt(a^2-b^2); print(X^2/a^2+Y^2/b^2 = 1);

This program works;. It is possible to simplify ? Thank you.

 

First 13 14 15 16 17 18 19 Last Page 15 of 27