JAMET

420 Reputation

4 Badges

7 years, 114 days

MaplePrimes Activity


These are questions asked by JAMET

restart;
with(geometry):
with(plots):
_EnvHorizontalName = 'x':
_EnvVerticalName = 'y':
EQ := proc(M, N) 
local eq, sol; 
eq := simplify(expand((y - M[2])/(x - M[1]) - (N[2] - M[2])/(N[1] - M[1]))); 
sol := solve(eq, y); 
RETURN(y = sol); end proc:
_local(D);
point(A, [-2, 7]):
point(B, [-5, -2]):
point(C, [8, -7]):
point(E, [1, 4]):
EQ([-5, -2], [8, -7]):
point(D, [1, subs(x = 1, rhs(%))]):
dsegment(sgAD, [A, D]):
BD := distance(B, D):
DC := distance(C, D):
triangle(ABC, [A, B, C]):
area(ABC):
triangle(ABD, [A, B, D]):
area(ABD):
triangle(ADC, [A, D, C]):
area(ADC):
is(area(ABD)/area(ADC) = BD/DC):
triangle(EBD, [E, B, D]):
area(EBD):
triangle(EDC, [E, D, C]):
area(EDC):
triangle(AEC, [A, E, C]):
area(AEC):
triangle(ABE, [A, B, E]):
area(ABE):
is(area(ABE)/area(AEC) = BD/DC):
display*([draw*[A(color = black, symbol = solidcircle, symbolsize = 6), 
B(color = black, symbol = solidcircle, symbolsize = 6), 
C(color = black, symbol = solidcircle, symbolsize = 6), 
ABC(color = blue)], 
textplot*([[coordinates(A)[], "A"], 
[coordinates(B)[], "B"], 
[coordinates(C)[], "C3"]], 
align = [above, right])], 
axes = none, 
title = "Lemme du Chevron");
The program simply reproduces display...Why; Thank you.
display*([draw*[A(color = black, symbol = solidcircle, symbolsize = 12), B(color = black, symbol = solidcircle, symbolsize = 12), C(color = black, symbol = solidcircle, symbolsize = 12), ABC(color = blue)], textplot*([[-2, 7, "A"], [-5, -2, "B"], [8, -7, "C3"]], align = [above, right])], axes = none, title = "Lemme du Chevron")

This figure refuses to turn
Fig := proc(t) local a, b, P, Q, N, R, TG, x0, y0, p1, p2, p3, po, tp, sol; a := 11; b := 7; R := sqrt(a^2 + b^2); P := [R*sin(t), R*cos(t)]; x0 := P[1]; y0 := P[2]; TG := (a^2 - x0^2)*(y - y0)^2 + (b^2 - y0^2)*(x - x0)^2 + 2*y0*x0*(x - x0)*(y - y0) = 0; p1 := implicitplot(x^2/a^2 + y^2/b^2 - 1, x = -11 .. 11, y = -7 .. 7, color = blue); p2 := implicitplot(x^2 + y^2 - a^2 - b^2, x = -15 .. 15, y = -15 .. 15, color = blue); p3 := implicitplot(TG, x = -15 .. 15, y = -15 .. 15, color = red); sol := solve({x^2/a^2 + y^2/b^2 - 1 = 0, TG}, {x, y}, explicit); Q := [subs(sol[1], x), subs(sol[1], y)]; N := [subs(sol[2], x), subs(sol[2], y)]; po := plot([P, Q, N], style = point, symbolsize = 15, symbol = solidcircle, color = red); tp := textplot([[P[], "P"], [Q[], "Q"], [N[], "N"]], 'align' = {'above', 'left'}); display([p1, p2, p3, po, tp], scaling = constrained); end procnFig := 60;
Figs := seq(Fig(2*Pi*i/nFig), i = 0 .. nFig);
Error, (in Fig) invalid subscript selector
display(Figs, insequence = true);
NULL; Why this error message. Thank you.

How to make this program more effective ?
 

A := [-3, 1, 2];
B := [-2, -1, 1];
C := [0, 3, -3];
                        A := [-3, 1, 2]

                        B := [-2, -1, 1]

                        C := [0, 3, -3]

alpha[1] := 2;#weight
alpha[2] := -1;
alpha[3] := 1;
                         alpha[1] := 2

                         alpha[2] := -1

                         alpha[3] := 1

x[1] := A[1];
x[2] := B[1];
x[3] := C[1];
                           x[1] := -3

                           x[2] := -2

                           x[3] := 0

y[1] := A[2];
y[2] := B[2];
y[3] := C[2];
                           y[1] := 1

                           y[2] := -1

                           y[3] := 3

z[1] := A[3];
z[2] := B[3];
z[3] := C[3];
                           z[1] := 2

                           z[2] := 1

                           z[3] := -3

sum(alpha[i], i = 1 .. 3);
                               2

xG := sum(alpha[i]*x[i], i = 1 .. 3)/sum(alpha[i], i = 1 .. 3);
                            xG := -2

yG := sum(alpha[i]*y[i], i = 1 .. 3)/sum(alpha[i], i = 1 .. 3);
                            yG := 3

zG := sum(alpha[i]*z[i], i = 1 .. 3)/sum(alpha[i], i = 1 .. 3);
                            zG := 0
Thank you.

restart;
with(geometry):
with(plots):
_EnvHorizont:lName = 'x';
_EnvVerticalName = 'y';
Vdot := proc(U, V) local i; add(U[i]*V[i], i = 1 .. 2); end proc;
R := 5;
ang := [3/4*Pi, -(3*Pi)/4, -Pi/6,4*Pi/9];
seq(point(`||`(P, i), [R*cos(ang[i]), R*sin(ang[i])]), i = 1 .. 4);
pts:=[seq(P || i,i=1..4)]:
seq(dsegment(`||`(seg, i), [`||`(P, i), `||`(P, irem(i, 4) + 1)]), i = 1 .. 4);
Triangle(Tr1,[P1,P2,P4]);
EulerCircle(Elc1,Tr1,'centername'=o);
circle(cir, [point(OO, [0, 0]), R]);
dist := proc(M, N) sqrt(Vdot(M - N, M - N)); end proc;
display(draw([P1(color = black, symbol = solidcircle, symbolsize = 12), 
P2(color = black, symbol = solidcircle, symbolsize = 12), 
P3(color = black, symbol = solidcircle, symbolsize = 12), 
P4(color = black, symbol = solidcircle, symbolsize = 12),seg1,
seg2,seg3,seq4,Tr1,Elc1,
cir(color = blue)]), 
textplot([[seq( [ coordinates(`||`(P, i))[], convert(`||`(P, i), string)],i=1..4], 
,align = [above, right]), axes = none);
does not recognize neg4 or tr1? I don't know to manage. Thank you.

restart;
with(geometry):
with(plots):
_EnvHorizontalName = 'x':
_EnvVerticalName = 'y':
Vdot := proc(U, V) local i; add(U[i]*V[i], i = 1 .. 2); end proc:
R := 5:
ang := [2/3*Pi, -3*Pi*1/4, -Pi*1/6]:
seq(point(`||`(P, i), [R*cos(ang[i]), R*sin(ang[i])]), i = 1 .. 3):
seq(dsegment(`||`(seg, i), [`||`(P, i), `||`(P, irem(i, 3) + 1)]), i = 1 .. 3):
circle(cir, [point(OO, [0, 0]), R]):
dist := proc(M, N) sqrt(Vdot(M - N, M - N)); end proc:


display*([draw*[P1(color = black, symbol = solidcircle, symbolsize = 12), 
P2(color = black, symbol = solidcircle, symbolsize = 12), 
P3(color = black, symbol = solidcircle, symbolsize = 12), 
cir(color = blue)], 
textplot*([[coordinates(P1)[], "P1"], 
[coordinates(P2)[], "P2"], 
[coordinates(P3)[], "P3"]], align = [above, right])], axes = none);
                /[                
 plots:-display |[geometry:-draw [
                \[                

   P1(color = black, symbol = solidcircle, symbolsize = 12), 

   P2(color = black, symbol = solidcircle, symbolsize = 12), 

   P3(color = black, symbol = solidcircle, symbolsize = 12), 

                                       /[[-5  5  (1/2)      ]  
   cir(color = blue)], plots:-textplot |[[--, - 3     , "P1"], 
                                       \[[2   2             ]  

   [  5  (1/2)    5  (1/2)      ]  [5  (1/2)  -5      ]]  
   [- - 2     , - - 2     , "P2"], [- 3     , --, "P3"]], 
   [  2           2             ]  [2         2       ]]  

                         \]             \
   align = [above, right]|], axes = none|
                         /]             /


no figure drawn, Why? Thank you

First 8 9 10 11 12 13 14 Last Page 10 of 32