JAMET

425 Reputation

4 Badges

7 years, 161 days

MaplePrimes Activity


These are replies submitted by JAMET

restart;
with(LinearAlgebra);
with(geometry);
with(plots);
_EnvHorizontalName := 'x';

_EnvVerticalName := 'y';

xA := -7: yA := 0: xB := 5: yB := 9: xC := 9: yC := 1: 
xP:=3:yP:=5:
point(A, xA, yA);
point(B, xB, yB);
point(C, xC, yC);
point(P, xP, yP);
Mat := Matrix(3,3,[xA,xB,xC,yA,yB,yC,1,1,1]);

"v := <x, y, 1>;

  1/Mat;

  Mcb := MatrixVectorMultiply(1/Mat, v);

  Mbc := MatrixVectorMultiply(Mat, Mcb);

  Triangle(Tr, [A, B, C]);

  line(AP, [A, P]);

  line(BP, [B, P]);

  line(CP, [C, P]);

  line(AB, [A, B]);

  line(BC, [B, C]);

  line(CA, [C, A]);

  alpha := FindAngle(BP, CP);

  beta := FindAngle(CP, AP);

  eta := FindAngle(BP, AP);

  Aa := FindAngle(AB, CA);

  Bb := FindAngle(BC, AB);

  Cc := FindAngle(BC, CA);

  t3 := thickness = 3;

  Mcb := <1/(cot(Aa) - cot(alpha)), 1/(cot(Bb) - cot(beta)), 

   1/(cot(Cc) - cot(eta))>;

  Mbc := MatrixVectorMultiply(Mat, Mcb);

  L3 := linestyle = 1;

  cbl := color = blue;

  dr := draw([AB, BC, CA, AP(cbl, L3), BP(cbl, L3), CP(cbl, L3)]);

  tp := textplot([[coordinates(A)[], "A"], [coordinates(B)[], 

   "B"], [coordinates(C)[], "C"], [coordinates(P)[], "P"]], 

   align = {above, right});

  display*[textplot*([[coordinates(A)[], "A"], [coordinates(B)[]\

  , "B"], [coordinates(C)[], "C"]], align = {"above", 

   'right'}), draw*([AP(color = black), BP(color = green), 

   CP(color = green), Tr(color = blue, filled = true, 

   transparency = 0.9)], axes = none)];"

Can you tell me why this program is not running ? Thank you.

                     "with(geometry);

                       with(LinearAlgebra);

                       with(plots);"


                  "_EnvHorizontalName := 'x'"


                   "_EnvVerticalName := 'y'"

xA := 1: yA := 0: xB := 0: yB := 0: xC := 0: yC := 1:
Mat := Matrix(3,3,[xA,xB,xC,yA,yB,yC,1,1,1]);
                        "v := <x, y, 1>"

            "Mcb := MatrixVectorMultiply(1/Mat, v)"

            "Mbc := MatrixVectorMultiply(Mat, Mcb)"

   "xA := 4;

     yA := 10;

     xB := 0;

     yB := -2;

     xC := 13;

     yC := 0;

     xP := 5;

     yP := 4;

     Mat := Matrix(3, 3, [xA, xB, xC, yA, yB, yC, 1, 1, 1]);"

            "Mcb := MatrixVectorMultiply(1/Mat, v)"

            "Mbc := MatrixVectorMultiply(Mat, Mcb)"

                  "point(A, xA, yA);

                    point(B, xB, yB);

                    point(C, xC, yC);

                    point(P, xP, yP);

                    triangle(Tr, [A, B, C]);"


                      "line(AP, [A, P]);

                        line(BP, [B, P]);

                        line(CP, [C, P]);"


                  "alpha := FindAngle(BP, CP)"

                  "beta := FindAngle(CP, AP)"

                   "eta := FindAngle(BP, AP)"

                      "line(AB, [A, B]);

                        line(BC, [B, C]);

                        line(CA, [C, A]);"


                             "NULL"

                   "Aa := FindAngle(AB, CA)"

                   "Bb := FindAngle(BC, AB)"

                   "Cc := FindAngle(BC, CA)"

  "Mcb := <1/(cot(Aa) - cot(alpha)), 1/(cot(Bb) - cot(beta)), 

     1/(cot(Cc) - cot(eta))>"


            "Mbc := MatrixVectorMultiply(Mat, Mcb)"

                    "t3 := thickness = 3;

                      L3 := linestyle = 1;

                      cbl := color = blue;"


"dr := draw([Tr(t3), AP(cbl, L3), BP(cbl, L3), CP(cbl, L3)]), 

   textplot([[coordinates(A)[], "A"], [coordinates(B)[], "B"], 

   [coordinates(C)[], "C"], [coordinates(P)[], "P"]], align = 

   {above, right})"

  "display({dr}, title = "Conversion", scaling = constrained, 

     axes = none, view = [-1 .. 14, -1 .. 11])"

Do you want to tell me why the program is not running ? Thank you very much.


How do you get these results? Thank you.

I want to write the equivalent of this statement with LinearAlgebra. Best regards.

the program following the previous
eta:=(x,y,z)->evalm(Mat&*[x,y,z]);        
eta(9/25,144/325,64/325); I should fond [4,18/5,1]. How to manufacture this adjutemen. Thank you.

 following the previous programme
eta:=(x,y,z)->evalm(Mat&x*[x,y,z]);  
eta:=(9/(25),144/(325),64/(325));
I should find :  [4,18/5,1]. Where is the mistake ? Thank you.

In order to calculate the real numbers cos(Pi/n), how to get the following polynomes
x^2 -3*x+1=0, x^3-6*x^2+10*x-4=0, x^4-8*x^3+20*x^2-20*x+5=0 and so on.
I got
F := (L, C) -> binomial(L - 2, C) + binomial(L - 2, C - 1);
for p from 5 to 10 do
    seq(F(p, p - i), i = 1 .. p);
end do;
Best regards.

Can you tell me why this program that seems correct does not work  Thank you very much.


        "restart;

          with(geometry);

          with(plots);

          _EnvHorizontalName = 'x';

          _EnvVerticalName = 'y';

          point(A, -3, 9);

          point(B, -5, 0);

          point(C, 6, 0);

          xA := -3;

          yA := 9;

          xB := -5;

          yB := 0;

          xC := 6;

          yC := 0;

          triangle(ABC, [A, B, C]);

          midpoint(M2, A, C);

          midpoint(M1, B, C);

          midpoint(M3, A, B);

          coordinates(M1);

          xM1 := %[1];

          yM1 := `%%`[2];

          coordinates(M2);

          xM2 := %[1];

          yM2 := `%%`[2];

          coordinates(M3);

          xM3 := %[1];

          yM3 := `%%`[2];

          segment(sA, [A, M1]);

          segment(sB, [B, M2]);

          segment(sC, [C, M3]);

          centroid(G, ABC);

          midpoint(J1, A, G);

          midpoint(J2, B, G);

          midpoint(J3, C, G);

          coordinates(J1);

          xJ1 := %[1];

          yJ1 := `%%`[2];

          coordinates(J2);

          xJ2 := %[1];

          yJ2 := `%%`[2];

          coordinates(J3);

          zA := xA + yA*I;

          zB := xB + yB*I;

          zC := xC + yC*I;

          F := z -> expand((z - zA)*(z - zB)*(z - zC));

          diff(F(z), z);

          sol := solve(%, z, explicit);

          evalf(sol[1]);

          evalf(sol[2]);"


                     "with(LinearAlgebra)"

"Mat := Matrix([[x^2, x*y, y^2, x, y, 1], [xM1^2, xM1*yM1, 

   yM1^2, xM1, yM1, 1], [xM2^2, xM2*yM2, yM2^2, xM2, yM2, 1], 

   [xM3^2, xM3*yM3, yM3^2, xM3, yM3, 1], [xJ1^2, xJ1*yJ1, 

   yJ1^2, xJ1, yJ1, 1], [xJ2^2, xJ2*yJ2, yJ2^2, xJ2, yJ2, 1]])"

                     "Determinant(Mat) = 0"

                            "M1;

                              M2;

                              M3;

                              J2;

                              J16;"

           "conic(Ell, [M1, M2, M3, J2, J1], [x, y])"

                        "Equation(Ell)"

                   "coordinates(foci_2_Ell);

                     evalf(%);"


                   "coordinates(foci_1_Ell);

                     evalf(%);"


              "point(F2, coordinates(foci_2_Ell))"

              "point(F1, coordinates(foci_1_Ell))"

"display(draw([A(color = black, symbol = solidcircle, 

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

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

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

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

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

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

   symbolsize = 12), F1(color = black, symbol = soli4*yM2, 

   yM1^2*dcircle, symbolsize = 12), F2(color = black, symbol = 

   solidcircle, symbolsize = 12), ABC(color = yellow, filled = 

   true, transparency = 0.5), Ell(color = blue, filled = true, 

   transparency = 0.3), M1(color = black, symbol = solidcircle, 

   symbolsize = 6), M2(color = black, symbol = solidcircle, 

   symbolsize = 6), M3(color = black, symbol = solidcircle, 

   symbolsize = 6), sA(color = blue), sB(color = blue), 

   sC(color = blue)]), textplot([[coordinates(A)[], "A"], 

   [coordinates(B)[], "B"], [coordinates(C)[], "C"], 

   [coordinates(G)[], "C"], [coordinates(J1)[], "J1"], 

   [coordinates(J2)[], "J2"], [coordinates(J3)[], "J3"], 

   [coordinates(F1)[], "F1"], [coordinates(F2)[], "F2"], 

   [coordinates(M1)[], "M1"], [coordinates(M2)[], "M2"], 

   [coordinates(M3)[], "M3"]], align = [above, right]), axes = 

   none)"

Q:= expand((z - zA)*(z - zB)*(z - zC));
q:=diff(Q,z), 
sol:= solve`(`q`, z ,explicit) ;
evalf(sol[1]);
evalf(sol[2]);
I don't understand the difficulty with diff. Best regards.

Q:=z-> diff((z - zA)*(z - zB)*(z - zC), z)*I);    
solve(Q(z) , z ,explicit) ;
Sorry, I’m too clumsy to take care of myself

Thank you very much for your task.
I try to find out a matrice 4X4 whuch calculates coordinates A->N, B->P, C->C and E->M.
it would take into account translation, rotation and ratio

will you take my example again and show that the procedure works. Thank you.

for i while (x := S || (i + 1))::And(algebraic, Not(name)) do
    S1 += x;
end do;
Error, recursive operator assignment
Sorry this instruction does not work.
 

@rlopez 
It is a very good prg.
Will you draw me a figure on an example ? Thank you.

@Kitonum 
For instance

A, B, C := <-3, 1, 2>, <-2, -1, 1>, <0, 3, -3>;
                 [&uminus0;3]  [&uminus0;2]  [    0     ]
                 [          ]  [          ]  [          ]
      A, B, C := [    1     ], [&uminus0;1], [    3     ]
                 [          ]  [          ]  [          ]
                 [    2     ]  [    1     ]  [&uminus0;3]

alpha := [a, b, c];
                       alpha := [a, b, c]

G := (A*alpha[1] + B*alpha[2] + C*alpha[3])/add(alpha);
G := Vector(3, {(1) = Typesetting:-mfrac(Typesetting:-mrow(Types\

  etting:-mo("&uminus0;"), Typesetting:-mrow(Typesetting:-mn("3"\

  ), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("a")),\

   Typesetting:-mo("&minus;"), Typesetting:-mrow(Typesetting:-mn\

  ("2"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("b\

  "))), Typesetting:-mrow(Typesetting:-mi("a"), Typesetting:-mo(\

  "&plus;"), Typesetting:-mi("b"), Typesetting:-mo("&plus;"), 

   Typesetting:-mi("c"))), (2) = Typesetting:-mfrac(Typesetting:\

  -mrow(Typesetting:-mi("a"), Typesetting:-mo("&minus;"), 

   Typesetting:-mi("b"), Typesetting:-mo("&plus;"), Typesetting:\

  -mrow(Typesetting:-mn("3"), Typesetting:-mo("&InvisibleTimes;"\

  ), Typesetting:-mi("c"))), Typesetting:-mrow(Typesetting:-mi("\

  a"), Typesetting:-mo("&plus;"), Typesetting:-mi("b"), 

   Typesetting:-mo("&plus;"), Typesetting:-mi("c"))), (3) = 

   Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mrow(Typese\

  tting:-mn("2"), Typesetting:-mo("&InvisibleTimes;"), 

   Typesetting:-mi("a")), Typesetting:-mo("&plus;"), 

   Typesetting:-mi("b"), Typesetting:-mo("&minus;"), 

   Typesetting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&Inv\

  isibleTimes;"), Typesetting:-mi("c"))), Typesetting:-mrow(Type\

  setting:-mi("a"), Typesetting:-mo("&plus;"), Typesetting:-mi("\

  b"), Typesetting:-mo("&plus;"), Typesetting:-mi("c")))})


solve({G[1] = A, G[2] = B, G[3] = C}, {a, b, c});
Error, invalid input: solve expects its 1st argument, eqs, to be of type {`and`, `not`, `or`, algebraic, relation(algebraic), ({list, set})({`and`, `not`, `or`, algebraic, relation(algebraic)})}, but received {(-3*a-2*b)/(a+b+c) = (Vector(3, {(1) = -3, (2) = 1, (3) = 2})), (a-b+3*c)/(a+b+c) = (Vector(3, {(1) = -2, (2) = -1, (3) = 1})), (2*a+b-3*c)/(a+b+c) = (Vector(3, {(1) = 0, (2) = 3, (3) = -3}))}
Why this program fails; Thank you.

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