JAMET

425 Reputation

4 Badges

7 years, 354 days

MaplePrimes Activity


These are questions asked by JAMET

On donne une ellipse rapportée à ses axes x^2/a^2+y^2/b^2-1=0 et une droite (D) qui rencontre cette
courbe en 2 points A et B. 
On considère un cercle variable passant parles points A et B et on demande le lieu géométrique des points de rencontre des tangentes communes au cercle et à l'ellipse.
restart;
with(plots);
with(VectorCalculus);
a := 5;
b := 3;
ellipse_eq := (x, y) -> x^2/a^2 + y^2/b^2 - 1;
m := 1;
c := -2;
line_eq := (x, y) -> y - m*x - c;
intersections := solve({line_eq(x, y) = 0, ellipse_eq(x, y) = 0}, {x, y}, explicit);
A := intersections[1];
B := intersections[2];
A := [VectorCalculus:-`+`(VectorCalculus:-`*`(25, 17^VectorCalculus:-`-`(1)), VectorCalculus:-`*`(VectorCalculus:-`*`(15, sqrt(30)), 34^VectorCalculus:-`-`(1))), VectorCalculus:-`+`(VectorCalculus:-`-`(VectorCalculus:-`*`(9, 17^VectorCalculus:-`-`(1))), VectorCalculus:-`*`(VectorCalculus:-`*`(15, sqrt(30)), 34^VectorCalculus:-`-`(1)))];
B := [VectorCalculus:-`+`(VectorCalculus:-`*`(25, 17^VectorCalculus:-`-`(1)), VectorCalculus:-`-`(VectorCalculus:-`*`(VectorCalculus:-`*`(15, sqrt(30)), 34^VectorCalculus:-`-`(1)))), VectorCalculus:-`+`(VectorCalculus:-`-`(VectorCalculus:-`*`(9, 17^VectorCalculus:-`-`(1))), VectorCalculus:-`-`(VectorCalculus:-`*`(VectorCalculus:-`*`(15, sqrt(30)), 34^VectorCalculus:-`-`(1))))];
center_x := VectorCalculus:-`*`(VectorCalculus:-`+`(A[1], B[1]), 2^VectorCalculus:-`-`(1));
center_y := VectorCalculus:-`*`(VectorCalculus:-`+`(A[2], B[2]), 2^VectorCalculus:-`-`(1));
radius := VectorCalculus:-`*`(sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(A[1], VectorCalculus:-`-`(B[1]))^2, VectorCalculus:-`+`(A[2], VectorCalculus:-`-`(B[2]))^2)), 2^VectorCalculus:-`-`(1));
circle_eq := (x, y) -> (x - center_x)^2 + (y - center_y)^2 - radius^2;
L := (x1, y1, x2, y2, lambda1, lambda2) -> (x1 - x2)^2 + (y1 - y2)^2 + lambda1*ellipse_eq(x1, y1) + lambda2*circle_eq(x2, y2);
eq1 := diff(L(x1, y1, x2, y2, lambda1, lambda2), x1);
eq2 := diff(L(x1, y1, x2, y2, lambda1, lambda2), y1);
eq3 := diff(L(x1, y1, x2, y2, lambda1, lambda2), x2);
eq4 := diff(L(x1, y1, x2, y2, lambda1, lambda2), y2);
eq5 := ellipse_eq(x1, y1);
eq6 := circle_eq(x2, y2);
sols := solve({eq1, eq2, eq3, eq4, eq5, eq6}, {lambda1, lambda2, x1, x2, y1, y2}, explicit);
sols;
lieu_geometrique := [seq([sols[i][1], sols[i][2]], i = 1 .. nops(sols))];
plot(lieu_geometrique, style = point, symbol = cross, color = red, title = "Lieu géométrique des points de rencontre");
Ce code m'a été donné en partie par l'intelligence artificielle (Mistral), mais il se plante. Pourriez-vous corriger les erreurs. Merci.

On considère un cercle fixe O et un point fixe A extérieur. Une sécante variable BC à ce cercle passe par un point fixe J.
Démontrer que le cercle ABC passe par un second point fixe P.
restart;
Proc := proc(m)
local xA, yA, xB, yB, xC, yC, xJ, yJ, tx, dr, Oo, c1, r, eqBJ, eq1, sol;
_EnvHorizontalName := 'x'; _EnvVerticalName := 'y';
xJ := 5; yJ := 1; geometry:-point(A, 2, 4); geometry:-point(J, xJ, yJ); geometry:-point(Oo, 0, 0);
r := 3; c1 := plottools[geometry:-circle]([0, 0], r, color = blue);
eqBJ := y = m*(x - xJ) + yJ; geometry:-line(BJ, eqBJ, [x, y]);
eq1 := x^2 + y^2 = r^2; sol := solve({eqBJ, eq1}, {x, y}, explicit);
xB := subs(sol[1], x); yB := subs(sol[1], y);
geometry:-point(B, xB, yB); xC := subs(sol[2], x); yC := subs(sol[2], y);
geometry:-point(C, xC, yC); geometry:-circle(c2, [A, B, C]); geometry:-line(AB, [A, B]); geometry:-line(AC, [A, C]);
eqBJ := y = m*(x - xJ) + yJ; geometry:-line(BJ, eqBJ, [x, y]);
eq1 := x^2 + y^2 = r^2; sol := solve({eqBJ, eq1}, {x, y},explicit);
xB := subs(sol[1], x); yB := subs(sol[1], y); geometry:-point(B, xB, yB);
xC := subs(sol[2], x); yC := subs(sol[2], y); geometry:-point(C, xC, yC);
geometry:-circle(c2, [A, B, C]); geometry:-line(AB, [A, B]); geometry:-line(AC, [A, C]);
tx := plots:-textplot([[geometry:-coordinates(A)[], "A"], [geometry:-coordinates(B)[], "B"], [geometry:-coordinates(C)[], "C"], [geometry:-coordinates(J)[], "J"]], font = [times, bold, 16], align = [above, right]);
dr := geometry:-draw([AB(color = black), c2(color = magenta), A(color = blue, symbol = solidcircle, symbolsize = 16),
B(color = red, symbol = solidcircle, symbolsize = 16), C(color = red, symbol = solidcircle, symbolsize = 16),
J(color = red, symbol = solidcircle, symbolsize = 16)]); plots:-display([dr, c1, tx], axes = normal, view = [-5 .. 6, -4 .. 6], scaling = constrained);
end proc;
plots:-animate(Proc, [m], m = -0.9 .. 0.2*Pi, frames = 50);
Error, (in plots/animate) two lists or Vectors of numerical values expected
NULL;
I am trying to find out point P; Thank you for your help.

OneFrame := proc(k)
local Courbe, T, a, b, c, t, P, Q, NormM, F, Ell, sol, N1, N2, dr, tx;
a := 11; b := 7; c := sqrt(a^2 - b^2); t := 1/3*Pi;
Ell := x^2/a^2 + y^2/b^2 = 1;
geometry:-point(T, (a^2 - b^2)*cos(t)^3/a, -(a^2 - b^2)*sin(t)^3/b);
Courbe := plots:-implicitplot(Ell, x = -a - 10 .. a + 10, y = -b - 10 .. b + 10, scaling = constrained, color = blue);
NormM := plots:-implicitplot(y - b*sin(t) = a*sin(t)*(x - a*cos(t))/(b*cos(t)), x = -a - 5 .. a + 10, y = -b - 10 .. b + 10, color = orange); geometry:-line(Per, y - b*sin(t) = a*sin(t)*(x - a*cos(t))/(b*cos(t)), [x, y]);
geometry:-point(P, subs(y = 0
, geometry:-Equation(Per), 0));
geometry:-point(Q, 0, subs(x = 0, geometry:-Equation(Per)));
geometry:-point(M, a*cos(t), b*sin(t));
geometry:-point(N1, a*cos(k), b*sin(k));
geometry:-point(F, 2.329411765, -2.567510609);
geometry:-line(L, N1, F);
sol := solve({geometry:-Equation(L), Ell}, {x, y},explicit);
geometry:-point(N2, subs(sol[2], x), subs(sol[2], y));
geometry:-segment(sg, N1, N2);
tx := plots:-textplot([[geometry:-coordinates(M)[], "M"],
[geometry:-coordinates(N1)[], "N1"], [geometry:-coordinates(N2)[], "N2"],
[geometry:-coordinates(P)[], "P"],
[geometry:-coordinates(Q)[], "Q"],
[geometry:-coordinates(F)[], "F point de Frégier"],
[geometry:-coordinates(T)[], "T"]], font = [times, bold, 16], align = [above, left]);
dr := geometry:-draw([sg(color = magenta, linestyle = dash),
Per(color = black), P(color = red, symbol = solidcircle, symbolsize = 12),
Q(color = red, symbol = solidcircle, symbolsize = 12),
M(color = black, symbol = solidcircle, symbolsize = 12),
F(color = red, symbol = solidcircle, symbolsize = 12),
N1(color = black, symbol = solidcircle, symbolsize = 8),
N2(color = black, symbol = solidcircle, symbolsize = 8),
T(color = black, symbol = solidcircle, symbolsize = 8)]);
plots:-display(Courbe, tx, dr, scaling = constrained, axes = none); end proc;

plots:-animate(OneFrame, [k], k = Pi/3 .. Pi, frames = 50);
Error, (in plots/animate) wrong type of arguments
Why this animation does't work ? Thank you very much.
 

restart;
with(plots);
A := [0, 0];
B := [4, 2];
C := [2, 3];
distance := proc(P1, P2) sqrt((P1[1] - P2[1])^2 + (P1[2] - P2[2])^2); end proc;
plot_triangle := proc(A, B, C) plot([A, B, C, A], style = line, color = black, thickness = 2); end proc;
plot_bisectors := proc(A, B, C) local AB, BC, CA, AB_bisector, BC_bisector, CA_bisector, i; AB := [A, B]; BC := [B, C]; CA := [C, A]; AB_bisector := [seq(A[i] + t*(B[i] - A[i]), i = 1 .. 2)]; BC_bisector := [seq(B[i] + t*(C[i] - B[i]), i = 1 .. 2)]; CA_bisector := [seq(C[i] + t*(A[i] - C[i]), i = 1 .. 2)]; plot([AB_bisector, BC_bisector, CA_bisector], t = 0 .. 1, style = line, color = blue, thickness = 2); end proc;
plot_apollonius := proc(A, B, C, ratio) local f, g; f := (x, y) -> sqrt((x - A[1])^2 + (y - A[2])^2)/sqrt((x - B[1])^2 + (y - B[2])^2) - ratio; g := implicitplot(f(x, y), x = -5 .. 5, y = -5 .. 5, grid = [100, 100], style = line, color = red, thickness = 2); g; end proc;
plot_inscribed_circle := proc(A, B, C) local a, b, c, s, r, Ii; a := distance(B, C); b := distance(A, C); c := distance(A, B); s := 1/2*a + 1/2*b + 1/2*c; r := sqrt((s - a)*(s - b)*(s - c)/s); Ii := [(a*A[1] + b*B[1] + c*C[1])/(a + b + c), (a*A[2] + b*B[2] + c*C[2])/(a + b + c)]; plot(circle(Ii, r), style = line, color = green, thickness = 2); end proc;
plot_exscribed_circles := proc(A, B, C) local a, b, c, s, rA, rB, rC, IA, IB, IC; a := distance(B, C); b := distance(A, C); c := distance(A, B); s := 1/2*a + 1/2*b + 1/2*c; rA := sqrt((s - b)*(s - c)*s/(s - a)); rB := sqrt((s - a)*(s - c)*s/(s - b)); rC := sqrt((s - a)*(s - b)*s/(s - c)); IA := [(a*A[1] - b*B[1] + c*C[1])/(a - b + c), (a*A[2] - b*B[2] + c*C[2])/(a - b + c)]; IB := [(a*A[1] + b*B[1] - c*C[1])/(a + b - c), (a*A[2] + b*B[2] - c*C[2])/(a + b - c)]; IC := [(-a*A[1] + b*B[1] + c*C[1])/(-a + b + c), (-a*A[2] + b*B[2] + c*C[2])/(-a + b + c)]; plot([circle(IA, rA), circle(IB, rB), circle(IC, rC)], style = line, color = magenta, thickness = 2); end proc;
with(geometry);
point(A1, 0, 0);
point(B1, 4, 2);
point(C1, 2, 3);
tx := textplot([[coordinates(A1)[], "A"], [coordinates(B1)[], "B"], [coordinates(C1)[], "C"]], font = [times, bold, 16], align = [above, left]);
triangle_plot := plot_triangle(A, B, C);
restart;
with(plots);
A := [0, 0];
B := [4, 2];
C := [2, 3];
distance := proc(P1, P2) sqrt((P1[1] - P2[1])^2 + (P1[2] - P2[2])^2); end proc;
plot_triangle := proc(A, B, C) plot([A, B, C, A], style = line, color = black, thickness = 2); end proc;
plot_bisectors := proc(A, B, C) local AB, BC, CA, AB_bisector, BC_bisector, CA_bisector, i; AB := [A, B]; BC := [B, C]; CA := [C, A]; AB_bisector := [seq(A[i] + t*(B[i] - A[i]), i = 1 .. 2)]; BC_bisector := [seq(B[i] + t*(C[i] - B[i]), i = 1 .. 2)]; CA_bisector := [seq(C[i] + t*(A[i] - C[i]), i = 1 .. 2)]; plot([AB_bisector, BC_bisector, CA_bisector], t = 0 .. 1, style = line, color = blue, thickness = 2); end proc;
plot_apollonius := proc(A, B, C, ratio) local f, g; f := (x, y) -> sqrt((x - A[1])^2 + (y - A[2])^2)/sqrt((x - B[1])^2 + (y - B[2])^2) - ratio; g := implicitplot(f(x, y), x = -5 .. 5, y = -5 .. 5, grid = [100, 100], style = line, color = red, thickness = 2); g; end proc;
plot_inscribed_circle := proc(A, B, C) local a, b, c, s, r, Ii; a := distance(B, C); b := distance(A, C); c := distance(A, B); s := 1/2*a + 1/2*b + 1/2*c; r := sqrt((s - a)*(s - b)*(s - c)/s); Ii := [(a*A[1] + b*B[1] + c*C[1])/(a + b + c), (a*A[2] + b*B[2] + c*C[2])/(a + b + c)]; plot(circle(Ii, r), style = line, color = green, thickness = 2); end proc;
plot_exscribed_circles := proc(A, B, C) local a, b, c, s, rA, rB, rC, IA, IB, IC; a := distance(B, C); b := distance(A, C); c := distance(A, B); s := 1/2*a + 1/2*b + 1/2*c; rA := sqrt((s - b)*(s - c)*s/(s - a)); rB := sqrt((s - a)*(s - c)*s/(s - b)); rC := sqrt((s - a)*(s - b)*s/(s - c)); IA := [(a*A[1] - b*B[1] + c*C[1])/(a - b + c), (a*A[2] - b*B[2] + c*C[2])/(a - b + c)]; IB := [(a*A[1] + b*B[1] - c*C[1])/(a + b - c), (a*A[2] + b*B[2] - c*C[2])/(a + b - c)]; IC := [(-a*A[1] + b*B[1] + c*C[1])/(-a + b + c), (-a*A[2] + b*B[2] + c*C[2])/(-a + b + c)]; plot([circle(IA, rA), circle(IB, rB), circle(IC, rC)], style = line, color = magenta, thickness = 2); end proc;
with(geometry);
point(A1, 0, 0);
point(B1, 4, 2);
point(C1, 2, 3);
tx := textplot([[coordinates(A1)[], "A"], [coordinates(B1)[], "B"], [coordinates(C1)[], "C"]], font = [times, bold, 16], align = [above, left]);
triangle_plot := plot_triangle(A, B, C);
bisectors_plot := plot_bisectors(A, B, C);
apollonius_plot := plot_apollonius(A, B, C, 1);
with(geometry);
inscribed_circle_plot := plot_inscribed_circle(A, B, C);
exscribed_circles_plot := plot_exscribed_circles(A, B, C);
display(triangle_plot, tx, bisectors_plot, apollonius_plot, axes = none, scaling = constrained, title = "Triangle with Bisectors, Apollonius Hyperbola, and Circles");
Error, (in plot) cannot determine plotting variable
Error, (in plot) cannot determine plotting variable
Warning, data could not be converted to float Matrix
Can you tel why these errors mean ? Thank you.
 

This code is working for function f1 but not for f2
f2 := (x,y)->9*x^2-24*x*y+16*y^2+10*x-70*y + 175;
Why this code is not working for f2 ?
unprotect(D);
f1:= (x, y) -> 3*x^2 - 3*y*x + 6*y^2 - 6*x + 7*y - 9;
coeffs(f(x, y));
A, B, C, D, E, F := %;
theta := 1/2*arctan(B/(A - C));
solve({-2*A*xc - B*yc = D, -B*xc - 2*C*yc = E});
assign(%);
x := xcan*cos(theta) - ycan*sin(theta) + xc;
y := xcan*sin(theta) + ycan*cos(theta) + yc;
Eq := simplify(expand(f1(x, y)));
xcan^2/simplify(sqrt(-tcoeff(Eq)/coeff(Eq, xcan^2)))^`2` + ycan^2/simplify(sqrt(-tcoeff(Eq)/coeff(Eq, ycan^2)))^`2` = 1;

Thank you

1 2 3 4 5 6 7 Last Page 2 of 33