JAMET

425 Reputation

4 Badges

7 years, 184 days

MaplePrimes Activity


These are questions asked by JAMET

restart; interface(rtablesize = 10): _EnvHorizontalName := 'x': _EnvVerticalName := 'y': eqPA := (y-b0)/(x-a0) = k: solPA := y=solve(eqPA, y): #k coefficient directeur de PA eqPB := (y-b0)/(x-a0) = -1/k: solPB :=y= solve(eqPB, y):#PB perpendicalaire à PA xA := solve(subs(y = 0, eqPA), x): yB := solve(subs(x = 0, eqPB), y): eqAB := x/xA+y/yB = 1; x k y k eqAB := --------- + --------- = 1 a0 k - b0 b0 k + a0 t := solve(a*(xM+(1/2)*t*a)+b*(yM+(1/2)*t*b)+c = 0, t); 2 (a xM + b yM + c) t := - ------------------- 2 2 a + b #Recherche des coordonnées de la projection d'un point sur une droite D #M(x,y)un point quelconque du plan, M'(x',y') son symé trique dans la symétrie orthogonale d'axe D #le vecteur MM' est colinéaire du vecteur normal n de D; vec(MM')=t.vec(n), n=


 

restart:
with(LinearAlgebra):
with(plots):
with(geometry):
with(plottools): # On appelle alpha la moitié de l'angle de rotation de la roue menée par tour de roue menante. alpha=Pi/n en raduans soit Pi/5=36° pour 5 rainures.. On a alors les relations suivantes entre l'entaxe E, le rayon de la roue ùenante R1 et le rayon de la roue menée R2 : R1=E.sin(alpha), R2=E*cos(alpha) Intersection du cercle (O,R2) avec la droite tan(phi)x-r/cos(phi), on obtient les coordonnées de P3
sol:=allvalues(solve([tan(phi)*x-r/cos(phi)=y,y^2+x^2=R2^2],[x,y])): # Intersection de 2 cercles
sol1:=allvalues(solve([(x-E)^2+y^2=(R-a)^2,y^2+x^2=R2^2],[x,y])): # Coordonnées des points du pourtour de l'élément de croix #point(O,0,0):
phi:=Pi/5:
R2:=5:
r:=1/4:
E:=R2/cos(phi):
R:=R2*tan(phi):
a:=0.5:
[(R2/2-r)*cos(phi),(R2/2-r)*sin(phi)];
geometry[point](P1,(R2/2-r)*cos(phi),(R2/2-r)*sin(phi)):
geometry[point](P2,(R2/2)*cos(phi)+r*sin(phi),(R2/2)*sin(phi)-r*cos(phi)):

[(9/4)*cos((1/5)*Pi), (9/4)*sin((1/5)*Pi)]

xP2:=(R2/2)*cos(phi)+r*sin(phi):
yP2:=(R2/2)*sin(phi)-r*cos(phi):
xP1:=(R2/2-r)*cos(phi):
yP1:=(R2/2-r)*sin(phi): # Equation paramétrique du segment OP1 (t varie de 0 à 1) ; non pris en compte
x1:=t*(0-xP1)+xP1:
y1:=t*(0-yP1)+yP1:
n1:=5:
dt:=1/(n1-1): #t varie entre 0 et 1

for i to n1 do tau:=(i-1)*dt:
xx[i]:=evalf(subs(t=tau,x1)):
yy[i]:=evalf(subs(t=tau,y1)): #print(i,xx[i],yy[i]);
od: # Equation paramétrique du quart de cercle P1P2 de la rainure (t varie de 0 à 1)
x2:=R2/2*cos(phi)+r*cos(t): #attention au sens de rotation du parcours de l'objet
y2:=R2/2*sin(phi)+r*sin(t):
n2:=6:
dt:=Pi/2/(n2-1): #arc de Pi/2
for i to n2 do
tau:=phi-Pi+(i-1)*dt:
xx[i]:=evalf(subs(t=tau,x2)):
yy[i]:=evalf(subs(t=tau,y2)):
od:
for i to n2 do
Vector[row]([i,xx[i],yy[i]])
od:

droite:=plot((tan(phi)*x-r/cos(phi),x=0..3),linestyle=dot,color=blue):

xP3:=evalf(subs(op(1,sol[1]),x)):
yP3:=evalf(subs(op(1,sol[1]),y)):
xP2:=evalf(subs(op(1,sol[2]),x)):
yP2:=evalf(subs(op(1,sol[2]),y)):
xP4:=evalf(subs(op(1,sol1[1]),x)):
yP4:=evalf(subs(op(1,sol1[1]),y)):
xP5:=E-(R-a):
yP5:=0:
x3:=t*(xP3-xP2)+xP2:
y3:=t*(yP3-yP2)+yP2:
n3:=10:
dt:=1/(n3-1): #t varie entre 0 et 1

for i to n3 do
tau:=(i-1)*dt:
xx[i+n2]:=evalf(subs(t=tau,x3)):
yy[i+n2]:=evalf(subs(t=tau,y3)):
od:

for i to n3 do Vector[row]([i,xx[i],yy[i]]) od:

x4:=xP5+R-a+(R-a)*cos(t):#attention au sens de rotation du parcours de l'objet
y4:=(R-a)*sin(t):
n4:=11:
eta:=arcsin(yP4/(R-a)):
dt:=(-eta)/(n2-1)/2:#arc de Pi/2

for i to n4 do
tau:=(Pi+eta)+(i-1)*dt: #recherche de tau ?
xx[i+n2+n3]:=evalf(subs(t=-tau,x4)):
yy[i+n2+n3]:=evalf(subs(t=-tau,y4)):
od:

for i to n4 do
Vector[row]([i,xx[i],yy[i]])
od:

n:=n2+n3+n4;
for i to n do
Vector[row]([i,xx[i],yy[i]])
od:

27

figure:=NULL:
for i from 0 to n do
xx[0]:=0:
yy[0]:=0:
figure:=figure,[xx[i],yy[i]]:
od:

figure:=[figure]:

polygonplot(figure,scaling=constrained,color=yellow);#,view=[-0.1..5,-0.1..3]

for i to n do
X[i]:=xx[i]:
Y[i]:=yy[i]
od:

d1:=plottools[disk]([xP1,yP1],0.05,color=blue):############ non définis
d2:=plottools[disk]([xP2,yP2],0.05,color=red):############ non définis

n := 27; ##### ci-dessus, il faut arrêter le trait à l'axe Ox ############### il suffit de prendre le symétrique puis 4 rotations de Pi/5 #############
symOX:= pt -> [pt[1],-pt[2]]:
rot:=proc(t,pt) [pt[1]*cos(t)-pt[2]*sin(t),pt[1]*sin(t)+pt[2]*cos(t)]; end:
figure1:=[ op(figure),op(map(symOX,figure))]:
croix:=op(figure1):

27

for i to 4 do croix:=croix,op(map( pt -> rot(i*2*Pi/5,pt),figure1) ): od:
croix:=[croix]:
polygonplot(croix,scaling=constrained,color=yellow); #How arrange this drawning and animate it. Thank you.

 


 

Download GenovaDrive.mw

[Just in case the above is not a 100%-correct presentation of the original code, I've left it below in its origianally posted form.--Carl Love as Moderator]

restart:with(LinearAlgebra):with(plots):with(geometry):with(plottools): On appelle alpha la moitié de l'angle de rotation de la roue menée par tour de roue menante. alpha=Pi/n en raduans soit Pi/5=36° pour 5 rainures.. On a alors les relations suivantes entre l'entaxe E, le rayon de la roue ùenante R1 et le rayon de la roue menée R2 : R1=E.sin(alpha), R2=E*cos(alpha) Intersection du cercle (O,R2) avec la droite tan(phi)x-r/cos(phi), on obtient les coordonnées de P3 sol:=allvalues(solve([tan(phi)*x-r/cos(phi)=y,y^2+x^2=R2^2],[x,y])): Intersection de 2 cercles sol1:=allvalues(solve([(x-E)^2+y^2=(R-a)^2,y^2+x^2=R2^2],[x,y])): Coordonnées des points du pourtour de l'élément de croix #point(O,0,0): phi:=Pi/5:R2:=5:r:=1/4:E:=R2/cos(phi):R:=R2*tan(phi):a:=0.5: [(R2/2-r)*cos(phi),(R2/2-r)*sin(phi)]: geometry[point](P1,(R2/2-r)*cos(phi),(R2/2-r)*sin(phi)): geometry[point](P2,(R2/2)*cos(phi)+r*sin(phi),(R2/2)*sin(phi)-r*cos(phi)): xP2:=(R2/2)*cos(phi)+r*sin(phi):yP2:=(R2/2)*sin(phi)-r*cos(phi): xP1:=(R2/2-r)*cos(phi):yP1:=(R2/2-r)*sin(phi): Equation paramétrique du segment OP1 (t varie de 0 à 1) ; non pris en compte x1:=t*(0-xP1)+xP1: y1:=t*(0-yP1)+yP1: n1:=5: dt:=1/(n1-1):#t varie entre 0 et 1 for i to n1 do tau:=(i-1)*dt: xx[i]:=evalf(subs(t=tau,x1)): yy[i]:=evalf(subs(t=tau,y1)): #print(i,xx[i],yy[i]); od: Equation paramétrique du quart de cercle P1P2 de la rainure (t varie de 0 à 1) x2:=R2/2*cos(phi)+r*cos(t):#attention au sens de rotation du parcours de l'objet y2:=R2/2*sin(phi)+r*sin(t): n2:=6: dt:=Pi/2/(n2-1):#arc de Pi/2 for i to n2 do tau:=phi-Pi+(i-1)*dt: xx[i]:=evalf(subs(t=tau,x2)): yy[i]:=evalf(subs(t=tau,y2)): od: for i to n2 do Vector[row]([i,xx[i],yy[i]]) od: droite:=plot((tan(phi)*x-r/cos(phi),x=0..3),linestyle=dot,color=blue): sol[1]: xP3:=evalf(subs(op(1,sol[1]),x)):yP3:=evalf(subs(op(1,sol[1]),y)): xP2:=evalf(subs(op(1,sol[2]),x)):yP2:=evalf(subs(op(1,sol[2]),y)): xP4:=evalf(subs(op(1,sol1[1]),x)):yP4:=evalf(subs(op(1,sol1[1]),y)): xP5:=E-(R-a):yP5:=0: x3:=t*(xP3-xP2)+xP2: y3:=t*(yP3-yP2)+yP2: n3:=10: dt:=1/(n3-1):#t varie entre 0 et 1 for i to n3 do tau:=(i-1)*dt: xx[i+n2]:=evalf(subs(t=tau,x3)): yy[i+n2]:=evalf(subs(t=tau,y3)): od: for i to n3 do Vector[row]([i,xx[i],yy[i]]) od: x4:=xP5+R-a+(R-a)*cos(t):#attention au sens de rotation du parcours de l'objet y4:=(R-a)*sin(t): n4:=11: eta:=arcsin(yP4/(R-a)): dt:=(-eta)/(n2-1)/2:#arc de Pi/2 for i to n4 do tau:=(Pi+eta)+(i-1)*dt:#recherche de tau ? xx[i+n2+n3]:=evalf(subs(t=-tau,x4)): yy[i+n2+n3]:=evalf(subs(t=-tau,y4)): od: for i to n4 do Vector[row]([i,xx[i],yy[i]]) od: n:=n2+n3+n4; for i to n do Vector[row]([i,xx[i],yy[i]]) od: figure:=NULL: for i from 0 to n do xx[0]:=0:yy[0]:=0: figure:=figure,[xx[i],yy[i]]: od: figure:=[figure]: polygonplot(figure,scaling=constrained,color=yellow):#,view=[-0.1..5,-0.1..3] for i to n do X[i]:=xx[i]: Y[i]:=yy[i] od: d1:=plottools[disk]([xP1,yP1],0.05,color=blue):############ non définis d2:=plottools[disk]([xP2,yP2],0.05,color=red):############ non définis n := 27 ##### ci-dessus, il faut arrêter le trait à l'axe Ox ############### il suffit de prendre le symétrique puis 4 rotations de Pi/5 ############# symOX:= pt -> [pt[1],-pt[2]]: rot:=proc(t,pt) [pt[1]*cos(t)-pt[2]*sin(t),pt[1]*sin(t)+pt[2]*cos(t)]; end: figure1:=[ op(figure),op(map(symOX,figure))]: croix:=op(figure1): for i to 4 do croix:=croix,op(map( pt -> rot(i*2*Pi/5,pt),figure1) ): od: croix:=[croix]: polygonplot(croix,scaling=constrained,color=yellow); How arrange this drawning and animate it. Thank you.

with(LinearAlgebra):
assign(seq(U || i = `<,>`(x[i], y[i]), i = 1 .. 3));
U || 4 := U || 1; r := (1/6)*sqrt(3);
assign(seq(V || i = (U || i+U || (i+1))*(1/2)+(`<,>`(`<|>`(0, 1), `<|>`(-1, 0)) . (U || (i+1)-U || i))*r, i = 1 .. 3)); Norm(V || 3-V || 1, 2); is(Norm(V || 3-V || 1, 2) = Norm(V || 3-V || 2, 2)); is(Norm(V || 2-V || 1, 2) = Norm(V || 3-V || 2, 2));

restart:with(geometry):with(plots): 
> S:=segment:L:=line:Per:=PerpendicularLine: 
> R:=5:xA:=0:yA:=0:point(A,xA,yA):xI:=R/3:yI:=0:point(I1,xI,yI): 
> circle(C,[A,R]): 

> quadri:=proc(t) 
> local xM,yM,xN,yN,xE,yE,dr1: 
> xM:=evalf(R*cos(t)):yM:=evalf(R*sin(t)):point(M,xM,yM):L(lMI,[M,I1]): 
> intersection('h',C,lMI,[M,N]):L(lAM,[A,M]):L(lAN,[A,N]): 
> Per(lME,M,lAM):Per(lNE,N,lAN):intersection(E,lME,lNE): 
> S(sAM,[A,M]):S(sAN,[A,N]):S(sME,[M,E]):S(sNE,[N,E]): 
> dr1:=draw({lMI(color=blue),sAM(color=black),sAN(color=black), 
> sME,sNE}): 
> display({dr1}): 
> end: 
  
> dr:=draw({C},view=[-6..17,-10..6]): 
> display([dr,quadri(0.7),quadri(1),quadri(1.2)],view=[-6..17,-10..6]); Thanks you.

E := proc (n::posint)
local L, x, y, z, p;
p := n; L := NULL;
assume(x::nonnegint, y::nonnegint, z::nonnegint);
assume(x <= y and y < =z);
for x from 1 to irem(p, 2) do
for y from x to irem(p, 2) do
for z from y to irem(p, 2) do
if x+y+z = p then L := L, [x, y, z] end if
end do
end do
end do;
return L end proc:
This procedure don't work. I would like E(9)={(1,4,4),(2,3,4),(3,3,3)} then E(2019), E(2022). Thank you.

First 29 30 31 32 33 Page 31 of 33