JAMET

355 Reputation

4 Badges

5 years, 48 days

MaplePrimes Activity


These are replies submitted by JAMET

Thank you for your answer; I found : 

restart;
with(plots):
with(geometry):
_EnvHorizontalName := x:
_EnvVerticalName := y:
R := 11:
r := 7:
a := sqrt(R*r):

b := 2:
circle(C1, [point(P1, [0, 0]), R]):
circle(C2, [point(P2, [R + 2*b + r, 0]), r]):
ellipse(p, (x - R - b)^2/b^2 + y^2/a^2 = 1):
draw([C1(color = yellow, filled = true), 
C2(color = red, filled = true), p(color = blue, filled = true), 
C1(color = black), C2(color = black), p(color = black)], 
axes = none, view = [-15 .. 35, -15 .. 15], scaling = constrained):
alpha := arctan((R - r)/(R + 2*b + r));
long := cos(alpha)*(R + 2*b + r);
evalf(%);
circle(C2, [point(P2, [long, r - R]), r]);
rotation(p1, p, alpha, 'clockwise');
detail(p1);
point(A, 0, -R);
point(B, long, -R);
line(L1, [A, B]);
point(cen, [(143*sqrt(5))/25, -(26*sqrt(5))/25]);
line(L, [P1, P2]);
reflection(L2, L1, L);
detail(L2);
draw([C1(color = yellow, filled = true), C2(color = red, filled = true), p1(color = blue, filled = true), C1(color = black), C2(color = black), p1(color = black), L1(color = black), L2(color = black)], axes = none, view = [-15 .. 35, -15 .. 15], scaling = constrained);
The drawing is a sangatku.

 

restart;
with(plots):
with(geometry):
_EnvHorizontalName := x:
_EnvVerticalName := y:
R := 7:
point(A, [0, R]):
line(L1, y = sqrt(3)*x + R):
line(L2, y = -sqrt(3)*x + R):
line(L3, y = R/3):
intersection(B, L1, L3):
intersection(C, L2, L3):

triangle(ABC, [A, B, C]):
circle(C1, [point(P1, [0, 0]), R]):
circle(C2, [point(P2, [0, R/3 + (2*R)/9]), (2*R)/9]):

center(C2), coordinates(center(C2)):
circle(C3, [reflection(P3, center(C2), C), radius(C2)]):
circle(C4, [reflection(P4, center(C2), B), radius(C2)]):
circle(C5,[reflection(P5, center(C3), L2), radius(C2)]):

detail(C5):
circle(C6, [point(P5, [0, R/3 - (2*R)/9]), radius(C2)]):
circle(C7, [point(P7,[0, R/3 - (2*R)/9-(4*R)/9]), radius(C2)]):
circle(C8, [point(P8,[0, R/3 - (2*R)/9-(8*R)/9]), radius(C2)]):

circle(Cir, [point(Po, [0, -R/3 ]), (2*R)/3]):
draw([L1(color = blue), 
ABC(color = red, transparency = 0.5, filled = true), 
L2(color = blue), L3(color = blue), 
C1(color = blue, thickness = 3), 
C1(color = yellow, transparency = 0.8, filled = true),
C2(color = blue, filled = true),
C3(color = blue, filled = true),
C4(color = blue, filled = true),
C5(color = blue, filled = true),
C6(color = blue, filled = true),
C7(color = blue, filled = true),
C8(color = blue, filled = true),
Cir(color = red,transparency = 0.5,filled=true)], 
axes = normal,
 view = [-R .. R, -R .. R], 
scaling = constrained);
I think a troucle with a symetry in respect to L2

I try differently
rotation(pol2,pol1,Pi/3,clockwise,o):
Error, (in geometry:-rotation) wrong type of arguments   Still that kind of error.

 

  restart:
  with(plots): with(geometry):
  _EnvHorizontalName := 'x':
  _EnvVerticalName := 'y':
  a := 7:
  point(E, 0, a*sqrt(3)/2):
  point(B, -a/2, 0):
  point(C, a/2, 0):
  point(o, 0, a*sqrt(3)/6):
  point(A, 0, a/2):
  point(H, 0, 0):
  R := (3-sqrt(3))*sqrt(2)*a/12:
  point(J, 0, a*sqrt(3)/6 - R):
  line(L1, -(7*x*sqrt(3))/6 + (7*y)/2 - (49*sqrt(3))/12 = 0):
  reflection(J1, J, L1):coordJ1:=coordinates(J1):
  
  line(L2, -(7*x*sqrt(3))/6 - (7*y)/2 + (49*sqrt(3))/12 = 0):
  reflection(J2, J, L2):coordJ2:=coordinates(J2):
  triangle(Tr1, [E, B, C]):
  triangle(Tr2, [A, B, C]):
  StretchRotation(E1, E, B, Pi/4, clockwise, sqrt(2)/2):
  coordinates(E1):
  StretchRotation(E2, E, C, Pi/4, counterclockwise, sqrt(2)/2):
  coordinates(E2):
  triangle(Tr3, [E, B, E1]):
  triangle(Tr4, [E, C, E2]):
  triangle(Tr5, [B, C, J]):
  circle(cir, [point(P1,[0,a*sqrt(3)/6]), R]):
  poly1 := Matrix( [ [0, a*sqrt(3)/2], 
                     coordJ1,
                    [0, a/2],
                    coordJ2
                  ],
                  datatype = float
                ):
  pol1 := polygonplot(poly1, colour = green, transparency = 0.7, gridlines):
  #poly2 := Matrix([ coordinates(J),coordinates(E1), coordJ2,|-a/2,0]],
                  datatype = float
                ):
  #pol2 := polygonplot(poly2, colour = green, transparency = 0.7, gridlines):

  tex := textplot([[0, a*sqrt(3)/2, "E"],[0,a*sqrt(3)/6 - R,"J"],
                    [-7/4 + (7*sqrt(3))/4, -7/4 + (7*sqrt(3))/4,"E1"],
                    [7/4 - (7*sqrt(3))/4, -7/4 + (7*sqrt(3))/4,"E2"],
                    [-7/4 + (((7*sqrt(3))/6 - 7*(3 - sqrt(3))*sqrt(2)/12)*sqrt(3))/2, 
                    (7*sqrt(3))/6 + 7*(3 - sqrt(3))*   sqrt(2)/24,"J1"],
                    [7/4 - (((7*sqrt(3))/6 - 7*(3 - sqrt(3))*sqrt(2)/12)*sqrt(3))/2, 
                    (7*sqrt(3))/6 + 7*(3 - sqrt(3))*   sqrt(2)/24,"J2"]], 'align' = {'above', 'right'}):
  display( [ draw( [ Tr1(color = cyan),
                     Tr3(color = green),
                     cir(color=blue),
                     Tr2(color = red),
                     Tr4(color = grey),
                     Tr1(color=blue)],'view' = [-5 .. 5, 0 .. 7
                   ], 
                   axes = normal,
                   scaling = constrained,
                   size=[800,800]
                   ),
            tex
           ]
          );

Error, `)` unexpected

  line(L1, [B, o]):
  Equation(L1):
  line(L1, -(7*x*sqrt(3))/6 + (7*y)/2 - (49*sqrt(3))/12 = 0):
  reflection(J1, J, L1):coordinates(J1):
  triangle(Tr6, [B, J1, E]):
  line(L2, [C, o]):
  Equation(L2):
  line(L2, -(7*x*sqrt(3))/6 - (7*y)/2 + (49*sqrt(3))/12 = 0):
  reflection(J2, J, L2):coordinates(J2):
  triangle(Tr7, [C, J2, E]):
  triangle(T1, [E, J1, A]):
  triangle(T2, [E, C, E2]):
  triangle(T3, [B, H, J]):
  triangle(T4, [C, H, J]):

  display( [ draw( [ cir(color = orange, filled = true, transparency = 0.1),
                     Tr6(color = blue, filled = true, transparency = 0.2),
                     Tr5(color = blue, filled = true, transparency = 0.2),
                     Tr7(color = blue, filled = true, transparency = 0.2)
                     
                   ],
                   axes = none,
                   scaling = constrained
                 ),
             pol1
           ]
         );
very difficult to find where I made mistakes; Thank you to help me.


Ihave still errors.
restart:
  with(geometry):
  _EnvHorizontalName := x:
  _EnvVerticalName := y:
  b := a*(1/2 + 1/6*sqrt(45 - 24*sqrt(3)))^2:
  r := b*sqrt(b)/(sqrt(a + b) + sqrt(a)):
  assume(a > 0);
  ellipse(E, x^2/a^2 + y^2/b^2 = 1):
  circle(C3, [point(P3, [(1 + sqrt(3))*r, -r]), r]):
  simplify(Equation(C3)):
  sol:= solve( [Equation(C3), Equation(E), x>0, y<0]):
  point(PP, [eval(x, sol), eval(y,sol)]):
  simplify(coordinates(PP));
 
Warning, solve may be ignoring assumptions on the input variables.
Error, invalid input: eval expects its 2nd argument, eqns, to be of type {integer, equation, set(equation)}, but received {x = ((3/13)*3^(1/2)*(15-8*3^(1/2))^(1/2)-(5/26)*3^(1/2)+(11/26)*(15-8*3^(1/2))^(1/2)+3/13)*a, y = -(1/4)*a*(4124*((3/13)*3^(1/2)*(15-8*3^(1/2))^(1/2)-(5/26)*3^(1/2)+(11/26)*(15-8*3^(1/2))^(1/2)+3/13)^4*3^(1/2)*(45-24*3^(1/2))^(1/2)+38376*((3/13)*3^(1/2)*(15-8*3^(1/2))^(1/2)-(5/26)*3^(1/2)+(11/26)*(15-8*3^(1/2))^(1/2)+3/13)^4*3^(1/2)+1476*((3/13)*3^(1/2)*(15-8*3^(1/2))^(1/2)-(5/26)*3^(1/2)+(11/26)*(15-8*3^(1/2))^(1/2)+3/13)^3*3^(1/2)*(45-24*3^(1/2))^(1/2)-7145*((3/13)*3^(1/2)*(15-8*3^(1/2))^(1/2)-(5/26)*3^(1/2)+(11/26)*(15-8*3^(1/2))^(1/2)+3/13)^4*(45-24*3^(1/2))^(1/2) ... 9/13)*(15-8*3^(1/2))^(1/2)+70542/13+426*(45-24*3^(1/2))^(1/2)), 0 < a}
Error, (in geometry:-coordinates) wrong type of argument

 

I am trying to know the coordinates of PP with a and b parameters
p and q are the lengths of the horizontal and vertical sides of the triangle T1
more I know that : xPP=a-2*a*p*(b-q)./(2*a*b-p*q): that  yPP=b-2*b*q*(a-p)./(2*a*b-p*q):and that 2*(a-p)*(b-q)=p*q)
Program attempt :
restart:
  with(geometry):
  _EnvHorizontalName := x:
  _EnvVerticalName := y:
  b := a*(1/2 + 1/6*sqrt(45 - 24*sqrt(3)))^2:
  r := b*sqrt(b)/(sqrt(a + b) + sqrt(a)):
  ellipse(E, x^2/a^2 + y^2/b^2 = 1):
  circle(C3, [point(P3, [(1 + sqrt(3))*r, -r]), r]):
  Equation(C3);

 
ellipse: hint: unable to determine if 1/a^4/(1/2+1/6*(45-24*3^(1/2))^(1/2))^4 is zero
Error, (in geometry:-ellipse) the given polynomial/equation is not an algebraic representation of a ellipse
circle: hint: a^(3/2)*(1/2+1/6*(45-24*3^(1/2))^(1/2))^3/((a+a*(1/2+1/6*(45-24*3^(1/2))^(1/2))^2)^(1/2)+a^(1/2)) > 0
Error, (in geometry:-circle) not enough information: the radius might not be positive
Error, (in geometry:-Equation) wrong type of argument
NULL;
Is it possible to find the coordinates of PP with a and b as parameters. Thank you very much.

Best reagards. Can you tell me why :IsOnCircle(PP, ic1); gives false.

restart;
with(geometry):
_EnvHorizontalName := x:
_EnvVerticalName := y:

a := 7:
b := a*(1/2 + 1/6*sqrt(45 - 24*sqrt(3)))^2:
r := b*sqrt(b)/(sqrt(a + b) + sqrt(a)):
Tt := [5.349255162, 2.829908743]:
eq := x*Tt[1]/a^2 + y*Tt[2]/b^2 = 1:
subs(y = b, eq):
Pp := [solve(%, x), b]:
subs(x = a, eq):
Qq := [a, solve(%)]:
point(P, Pp[1], Pp[2]):
point(Q, Qq[1], Qq[2]):

point(A, -a, -b):
point(B, -a, b):
point(C, a, b):
point(F, a, -b):
point(T, [5.349255162, 2.829908743]):
square(Sq, [A, B, C, F]):
line(Lig,x=0):
line(Liq,y=0):
triangle(PQC,[P,Q,C]):
incircle(Cir1, PQC, 'centername' = o):
circle(C1, [point(P1, [r, 0]), r]):
circle(C2, [point(P2, [(1 + sqrt(3))*r, r]), r]):
circle(C3, [point(P3, [(1 + sqrt(3))*r, -r]), r]):
ellipse(E, x^2/a^2 + y^2/b^2 = 1, [x, y]):
fsolve( {Equation(C1), x^2/a^2 + y^2/b^2 = 1}, complex):
reflection(C4, C1, Lig):
reflection(C5, C2, Lig):
reflection(C6, C3, Lig):
reflection(Cir2, Cir1, Lig):
reflection(Cir3,Cir1,Liq):
reflection(Cir4,Cir2,Liq):
  draw( [ Sq(color = blue,filled=true,thickness=4,transparency=0.7),
          C1(color = orange, filled = true,transparency=0.7),
          E(color=white,thickness=4),
          C2(color = orange, filled = true,transparency=0.7),
          C3(color = orange, filled = true,transparency=0.7),
          C4(color = orange, filled = true,transparency=0.7),
          C5(color = orange, filled = true,transparency=0.7),
          C6(color = orange, filled = true,transparency=0.7),
          Cir1(color = red, filled = true,transparency=0.5),
          Cir2(color = red, filled = true,transparency=0.5),
          Cir3(color = red, filled = true,transparency=0.5),          
          Cir4(color = red, filled = true,transparency=0.5),

          Sq(color=blue)
        ],
        axes = none,
        view = [-a .. a, -b .. b],
        scaling = constrained
      );The coordinates of T are approximate; Can be done better.Choose colors with RGB.Thank you.

Cen := proc(M, N, R) local eq1, eq2, sol;
eq1 := EqBIS(M, N, R) = 0;
eq2 := EqBIS(N, M, R) = 0;
sol := simplify(solve({eq1, eq2}, {x, y}));
RETURN([subs(sol, x), subs(sol, y)]);
end proc
  Ce := Cen(P, Dd, Q);
Error, (in LinearAlgebra:-Norm) expects its 1st argument, A, to be of type {Matrix, Vector}, but received [-5, 0]

  Why have I this message ?     Thank youi.               

restat;
with(plots);
_EnvHorizontalName := 'x';
_EnvVerticalName := 'y';
a := 11;
b := 5;
NULL;
fig := proc(theta) local aa, bb, ell, Ell, m, p, sol, A, B, C, Dd, quadri; global a, b; ell := (x*cos(theta) + y*sin(theta))^2/a^2 + (x*sin(theta) - y*cos(theta))^2/b^2 = 1; sol := solve({y = m, ell}, {x, y}, explicit); subs(sol[1], x) = subs(sol[2], x); sol := solve(%, m); bb := sol[1]; sol := solve({x = p, ell}, {x, y}, explicit); subs(sol[1], y) = subs(sol[2], y); sol := solve(%, p); aa := sol[1]; A := [aa, bb]; B := [aa, -bb]; C := [-aa, -bb]; Dd := [-aa, bb]; Ell := implicitplot(ell, x = -12 .. 12, y = -12 .. 12, thickness = 3, color = blue); quadri := plot([A, B, C, Dd, A], color = pink, filled = true); display([quadri, Ell], scaling = constrained, axes = none); end proc;
nframes := 10:
frames := seq(fig(2*Pi*i/(2*nframes)), i=0..nframes-1):
display(frames, insequence);

Thank you for your last programma. Here is mine who needs to be improved.

Apart from the animation, I consider that your program is more complicated than mine. Would you have an animation without Geometry ?

restat;
with(plots);
_EnvHorizontalName := 'x';
_EnvVerticalName := 'y';
a := 11;
b := 5;
theta := Pi/5;

ell := (x*cos(theta) + y*sin(theta))^2/a^2 + (x*sin(theta) - y*cos(theta))^2/b^2 = 1;
sol := solve({ell, y = m}, {x, y}, explicit);
subs(sol[1], x) = subs(sol[2], x);
sol := solve(%, m);
bb := sol[1];
evalf(%);
                          -7.626741393

sol := solve({ell, x = m}, {x, y}, explicit);
subs(sol[1], y) = subs(sol[2], y);
sol := solve(%, m);

aa := sol[1];
evalf(%);
                          -9.371916332

A := [aa, bb];
B := [aa, -bb];
C := [-aa, -bb];
Dd := [-aa, bb];
Ell := implicitplot(ell, x = -12 .. 12, y = -12 .. 12, thickness = 3, color = blue);
quadri := plot([A, B, C, Dd, A], color = pink, filled = true);

display([quadri, Ell], scaling = constrained, axes = none);

As "it is this program works;I wish it rotates when theta varies.

 

 

Very good program; Thanks Tom Leslie .And without  using Geometry ?

restart:local D:
  with(plots):
  with(plottools):
 

a := 7;
b := a/2;
NULL;

r := b/2;
c := 2*sqrt(10)*r;
A := [c/2, c/2];
B := [c/2, -1/2*c];
C := [-c/2, (-c)/2];
D := [-c/2, c/2];
f := (x, y) -> x^2/a^2 + y^2/b^2 = 1;

Ell1 := implicitplot(5/98*x^2 - 3/49*x*y + 5/98*y^2 = 1, x = -9 .. 9, y = -6 .. 6, color = white);
g := (x, y) -> x^2/b^2 + y^2/a^2 = 1;

Ell2 := implicitplot(5/98*x^2 + 3/49*x*y + 5/98*y^2 = 1, x = -9 .. 9, y = -6 .. 6, color = white);
quadri := plot([A, B, C, D, A], x = -6 .. 6, y = -6 .. 6, filled = true, color = red, transparency = 0.6);
Cir1 := disk([c/2 - r, -c/2 + r], r, color = blue);
Cir2 := disk([-c/2 + r, -c/2 + r], r, color = blue);
Cir3 := disk([-c/2 + r, c/2 - r], r, color = blue);
Cir4 := disk([c/2 - r, c/2 - r], r, color = blue);
display([quadri, Ell1, Ell2, Cir1, Cir2, Cir3, Cir4], scaling = constrained, axes = normal);

Is it possible to have while the inside of the ellipses ?

Thanks a lot.
Here is my last pgr.
How to animate this drawing moving P1 in the circle dfor instance

restart;
with(plots): with(plottools):with(LinearAlgebra): unprotect(D);
_EnvHorizontalName := 'x':
_EnvVerticalName := 'y':
Vdot := proc (U, V)local i: add(U[i]*V[i], i = 1 .. 2) end proc:
dist := proc (M, N) sqrt(Vdot(expand(M-N), expand(M-N))) end proc:
MinDistPoint := proc (A::[algebraic, algebraic], B::[algebraic, algebraic], P::[algebraic, algebraic]) 
local D, R, V; 
description "Point on line AB at minimum distance from P";
D := `<,>`(A-B); R := `<,>`(`<|>`(0, -1), `<|>`(1, 0)); 
V := `<,>`(`<,>`(P) . D, -R . `<,>`(A) . `<,>`(B)); `~`[`/`]([V . D, R . V . D], ` $`, D . D) 
end proc:

EqBIS := proc(P, U, V) local a, eq1, M1, t, PU, PV, bissec1; a := (P - U)/LinearAlgebra:-Norm(P - U, 2) + (P - V)/LinearAlgebra:-Norm(P - V, 2); M1 := P + a*t; eq1 := op(eliminate({x = M1[1], y = M1[2]}, t)); RETURN(op(eq1[2])); end proc;

Cen := proc(M, N, R) local eq1, eq2, sol; eq1 := EqBIS(M, N, R) = 0; eq2 := EqBIS(N, M, R) = 0; sol := simplify(solve({eq1, eq2}, {x, y})); RETURN([subs(sol, x), subs(sol, y)]); end proc;


CircleParm := t -> [(-t^2 + 1)/(t^2 + 1), 2*t/(t^2 + 1)];
NULL;
P1 := Vector(CircleParm(1/3)):

P2 := Vector(CircleParm(5)):
P3 := Vector(CircleParm(-1/10)):
P4 := Vector(CircleParm(-19/2)):
p1 := convert(P1, list);
p2 := convert(P2, list);
p3 := convert(P3, list);
p4 := convert(P4, list);
C4 := Vector(Cen(P1, P2, P3)):H := convert(C4, list):
C1 := Vector(Cen(P4, P2, P3));
J := convert(C1, list);
C2 := Vector(Cen(P4, P1, P3));
Ii := convert(C2, list);
C3 := Vector(Cen(P4, P2, P1));
K := convert(C3, list);
Pts := [P1, P2, P3, P4, C1, C2, C3, C4]:
r4 := dist(MinDistPoint(p1, p2, H), H);
r2 := dist(MinDistPoint(p1, p4, Ii), Ii);
r1 := dist(MinDistPoint(p2, p3, J), J);
r3 := dist(MinDistPoint(p2, p1, K), K);
Cir1 := circle(Ii, r2, color = black);
Cir2 := circle(K, r3, color = black);
Cir3 := circle(J, r1, color = black);
Cir4 := circle(H, r4, color = black);
Poly := polygonplot([p1, p2, p4, p3, p1], color = blue, transparency = 0.9);
SegP1P4 := plot([p1, p4], color = black);
SegP2P3 := plot([p2, p3], color = black);
quadri := plot([p1, p2, p4, p3, p1], color = black);
rect := polygonplot([H, Ii, J, K, H], color = red, transparency = 0.7);
tex := textplot([[p1[], "P1"], [p2[], "P2"], [p3[], "P3"], [p4[], "P4"], [H[], "H"], [Ii[], "I"], [J[], "J"], [K[], "K"]], align = ["above", "right"]);
display(Poly, tex, quadri, rect, SegP1P4, SegP2P3, Cir1, Cir2, Cir3, Cir4, implicitplot([x^2 + y^2 - 1], x = -2 .. 2, y = -4 .. 2, colour = [blue], scaling = constrained), pointplot(Pts, symbolsize = 16), axes = none);

1 2 3 4 5 6 7 Page 1 of 7