JAMET

370 Reputation

4 Badges

6 years, 111 days

MaplePrimes Activity


These are questions asked by JAMET

Problema with textplot

restart:with(plots):
  with(geometry):
  _EnvHorizontalName := 'x':
  _EnvVerticalName := 'y':
  a := 7:
  b := 3:
  ellipse(p, x^2/a^2 + y^2/b^2 - 1, [x, y]):
  Fig := proc(t)
              local M, l1,L1,L2,  q, m, c , tex;
              global a, b, p;
              point(M, a*cos(t), b*sin(t));
              if   VerticalCoord(M)=0
              then line(l1, x=HorizontalCoord(M));
              else m:=eval[recurse]( rhs
                                     ( isolate
                                       ( diff
                                         ( eval
                                           ( Equation(p),
                                             y=y(x)
                                           ),
                                           x
                                         ),
                                         diff(y(x),x)
                                       )
                                     ),
                                     [ y(x)=y,
                                       x=HorizontalCoord(M),
                                       y=VerticalCoord(M)
                                     ]
                                   );
                   c:=VerticalCoord(M)-m*HorizontalCoord(M);
                   line(l1, y=m*x+c);
              fi;
              reflection(q, p, l1);
              line(L1, [point(P1, evalf~(coordinates(foci(q)[1]))),
                            point(P2, evalf~(coordinates(foci(q)[2])))]):  
              line(L2, [point(P3, evalf~(coordinates(foci(p)[1]))),
                            point(P4, evalf~(coordinates(foci(p)[2])))]): 
              segment(P1P3,[P1,P3]): circle(cir1,[P3,2*a]):
              segment(P2P4,[P2,P4]): 
              circle(cir1,[P3,2*a]): circle(cir2,[P4,2*a]):
              textplot([[P2[], "F1"], [P4[], "F2"]], font = [times, 10], align = {below, left}):            
              draw( [ p(color = blue),P1P3(color=magenta,linestyle=3),
                      q(color = blue),P2P4(color=magenta,linestyle=3),
                      l1(color = black),L1(color = black),cir1(color=magenta,linestyle=3),
                      cir2(color=magenta,linestyle=3),
                      M(color = blue, symbol = solidcircle, symbolsize = 16),
                      P1(color = red, symbol = solidcircle, symbolsize = 16),
                      P2(color = red, symbol = solidcircle, symbolsize = 16),
                      P3(color = red, symbol = solidcircle, symbolsize = 16),
                      P4(color = red, symbol = solidcircle, symbolsize = 16)
                    ],
                    axes = none,
                    scaling = constrained);
          end proc:
#
# Change nFig to type float
#
   nFig := 180.0:
#
# Make sure loop index is a float, and change end point
# on loop to nFig-1.0
#
   Figs := seq(Fig(2*Pi*i/nFig), i = 0.0 .. nFig-1.0):
   plots:-display(Figs, insequence = true);
Error, (in plots:-textplot) improper op or subscript selector
Error, (in plots:-display) expecting plot structure but received: Figs

_local(D);
f := (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(f(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;
a := sqrt(-tcoeff(Eq)/coeff(Eq, xcan^2));
b := sqrt(-tcoeff(Eq)/coeff(Eq, ycan^2));
c := sqrt(a^2 - b^2);
F1 := [xc + c*cos(theta), yc + c*sin(theta)];
evalf(%);
F1 := [xc - c*cos(theta), yc - c*sin(theta)];
evalf(%);
Points := pointplot([F1[], F2[]], symbol = solidcircle, color = [red], symbolsize = 6);
xcan := plot(yc + tan(theta)*('x' - xc), 'x' = -2 .. 3.5, color = black);
ycan := plot(yc - ('x' - xc)/tan(theta), 'x' = 0.1 .. 1.5, color = black);
Ellipse := plots[implicitplot](f('x', 'y'), 'x' = -2 .. 3.5, 'y' = -2 .. 1.5, color = red, thickness = 2, gridrefine = 5);
labels := plots[textplot]([[0.4, 1.3, "ycan"], [3.2, 0.75, "xcan"]], font = [TIMES, ROMAN, 14]);
plots[display](xcan, ycan, Points, Ellipse, labels, scaling = constrained);

I do not why I get this message:

Error, (in plots:-display) expecting plot structure but received: pointplot([17/21-(2/21)*(1407/(-(3/2)*2^(1/2)+9/2)-1407/((3/2)*2^(1/2)+9/2))^(1/2)*cos((1/8)*Pi), -8/21-(2/21)*(1407/(-(3/2)*2^(1/2)+9/2)-1407/((3/2)*2^(1/2)+9/2))^(1/2)*sin((1/8)*Pi), F2[]], symbol = solidcircle, color = [red], symbolsize = 6) NULL;

Thank you for your help.
 

Fig := proc(t) 
local xD, yD, D, C, Ii, Points, tex,sol; 
global A, B, b, Omega1, EL1, EL2; 
xD := Omega1[1] + aa*cos(t); 
yD := bb*sin(t); 
D := [xD, yD]; 
C := [xD + b, yD]; 
sol:=solve({EQ(A,D),EQ(C,B)},{x,y});
Ii:=[subs(sol,x),subs(sol,y)]:
Points := pointplot([A[], B[], C[], C[], D[], E[], Omega1[]], symbol = solidcircle, color = [red], symbolsize = 6); 
tex := textplot([[A[], "A"], [B[], "B"], [C[], "C"], [D[], "D"], [E[], "E"], [Omega1[], "Ω1"]], align = ["above", "right"]); 
display([polygonplot([A, B, C, D], color = blue, filled = true, transparency = 0.9), Points, tex, EL1, EL2,plot([D,Ii]),plot([Ii,C])], axes = normal, scaling = constrained); end proc:
Fig((3*Pi)/4):
display([seq(Fig((2*Pi*i)/40), i = 1 .. 80)], insequence = true);
Warning, data could not be converted to float Matrix
Warning, data could not be converted to float Matrix
Warning, data could not be converted to float Matrix
Warning, data could not be converted to float Matrix
Warning, data could not be converted to float Matrix
Warning, data could not be converted to float Matrix
Warning, data could not be converted to float Matrix
Warning, data could not be converted to float Matrix
I am sorry; How to manage with such a message. Thank you very much.

restart;
with(plots):
_local(D):

EQ := proc(M, N) local eq; eq := (y - M[2])/(x - M[1]) = (N[2] - M[2])/(N[1] - M[1]); end proc;
     EQ := proc (M, N) local eq; eq := (y-M[2])/(x-M[1]) = 

        (N[2]-M[2])/(N[1]-M[1]) end proc


On considère un trapèze dans lequel une base est fixe l'autre base a une longueur constante et la somme des 2 autres côtés est constaante.
Trouver :
1-. le lieu des sommets mobiles.
A := [xA, 0]:
B := [xA + a, 0]:
D := [xD, yD]:
C := [xD + b, yD]:
EQ(B, C);
E := [xA + a - b, 0]:
Omega1 := (A + E)/2;
Application numérique :
Lieux des sommets C et D

xA := -5:
a := 13:#a>=b
b := 7:
c := -3:
xD := -6:
xC := xD + c:

A:
B:
C:
D:
Ll:=11:aa:= Ll/2: 
cc := (a - b)/2:
bb := sqrt(aa^2 - cc^2):
el1 := (x - Omega1[1])^2/aa^2 + y^2/bb^2 = 1:
sol := solve(subs(x = xD, (x - Omega1[1])^2/aa^2 + y^2/bb^2 = 1), y):
yD := sol[1]:
el2 := (x - Omega1[1] - b)^2/aa^2 + y^2/bb^2 = 1:
EL1 := implicitplot(el1, x = -9 .. 4, y = -6 .. 6, color = blue):
EL2 := implicitplot(el2, x = -9 .. 12, y = -6 .. 12, color = blue):
Trap := polygonplot([A, B, C, D], color = blue, filled = true, transparency = 0.9):
Points := pointplot([A[], B[], C[], C[], D[], E[], Omega1[]], symbol = solidcircle, color = [red], symbolsize = 6):
tex := textplot([[A[], "A"], [B[], "B"], [C[], "C"], [D[], "D"], [E[], "E"], [Omega1[], "Ω1"]], align = ["above", "right"]):
display([Trap, EL1, EL2, tex, Points], axes = normal, scaling = constrained):
Fig := proc(xD) 
local yD, D, C,Points,tex; 
global A, B, b, Omega, xA, xB, EL1, EL2; 
solve(subs(x = xD, (x - Omega1[1])^2/aa^2 + y^2/bb^2 = 1), y); 
yD := %[1]; D:= [xD, yD]; C := [xD + b, yD];
Points := pointplot([A[], B[], C[], C[], D[], E[], Omega1[]], symbol = solidcircle, color = [red], symbolsize = 6): 
tex := textplot([[A[], "A"], [B[], "B"], [C[], "C"], [D[], "D"], [E[], "E"], [Omega1[], "Ω1"]], align = ["above", "right"]):
display([polygonplot([A, B, C, D], color = blue, filled = true, transparency = 0.9), Points,tex,EL1, EL2], axes = normal, scaling = constrained); 
end proc:

Fig(2):Fig(-4):
Fig([seq(-6 + 3*i/10), i = 1.20], insequence = true);
Error, (in Engine:-Dispatch) badly formed input to solve: not fully algebraic
;I don't understand this error message. Thank you gfor your help.
 

How to improve this program ? Thank you.

restart;
Equation de la conique
eqcon := (45 - 27*cos(alpha))*x^2 - 54*sin(alpha)*x*y + (45 + 27*cos(alpha))*y^2 - 8;
Delta := (-54*sin(alpha))^2 - 4*(45 - 27*cos(alpha))*(45 + 27*cos(alpha));
expand(%);
simplify(%);
Discriminant : Δ<0 ce qui correxpond à une ellipse
Eq := simplify(expand(subs(x = cos(alpha/2)*X - sin(alpha/2)*Y, y = sin(alpha/2)*X + cos(alpha/2)*Y, eqcon)));
kx := coeff(Eq, X, 2);
ky := coeff(Eq, Y, 2);
k := -tcoeff(Eq);

EQ := X^2/(sqrt(1/kx^2)*k) + Y^2/(sqrt(1/ky^2)*k) = 1;
Calcul du grand et du petit axe 
a := 1/sqrt(coeff(lhs(EQ), X, 2));
b := 1/sqrt(coeff(lhs(EQ), Y, 2));
print(X^2/('a^2') + Y^2/('b^2') = 1);
 

2 3 4 5 6 7 8 Last Page 4 of 24