5-1 Construct the envelope of the light rays emitted from a radiant point source
at infinity after reflection by the semi-circle.
> restart;
> m:=[[-3,sin(t)],[cos(t),sin(t)],[cos(t)-cos(2*t),sin(t)-sin(2*t)]];
> t:=k*2*Pi/100-Pi/2;
> plot([m$k=0..50],scaling=constrained,color=green,axes=none);
5-2 Construct the envelope of the light rays emitter from a radient point source
at the circumference after reflection by the same circle
> restart;
> m:=[[-1,0],[cos(t),sin(t)],[cos(t)-cos(3*t/2),sin(t)-sin(3*t/2)]];
> t:=k*2*Pi/100-Pi;
> plot([m$k=0..100],scaling=constrained,color=blue,axes=none);
5-3 Construct the envelope formed by a fix diameter of a circle
rolling along a straight line
> restart;
> m:=[[t-cos(t),sin(t)],[t+cos(t),-sin(t)]];
> t:=n*2*Pi/100;
> plot([m$n=-100..100],scaling=constrained,color=gold,axes=none);
5-4 Construct the envelope formed by a fix diameter of a circle
rolling along a fixed circle of the same size
> restart;
> m:=[[2*cos(t)-cos(2*t),2*sin(t)-sin(2*t)],[2*cos(t)+cos(2*t),2*sin(t)+sin(2*t)]];
> t:=k*2*Pi/100;
> plot([m$k=0..100],scaling=constrained,color=pink,axes=none);
5-5 Construct the envelope formed by a fix diameter of a circle
rolling along a fixed circle twice the diameter
> restart;
> m:=[[3*cos(t)-cos(3*t),3*sin(t)-sin(3*t)],[3*cos(t)+cos(3*t),3*sin(t)+sin(3*t)]];
> t:=k*2*Pi/100;
> plot([m$k=0..100],scaling=constrained,color=brown,axes=none);
5-6 Construct the figure
> restart;
> m:=[[-3*cos(t)-cos(-3*t),-3*sin(t)-sin(-3*t)],[-3*cos(t)+cos(-3*t),-3*sin(t)+sin(-3*t)]];
> t:=k*2*Pi/100;
> plot([m$k=0..100],scaling=constrained,color=orange,axes=none);
5-7 Construct this figure
> restart;
> m:=[[-4*cos(t)-cos(-4*t),-4*sin(t)-sin(-4*t)],[-4*cos(t)+cos(-4*t),-4*sin(t)+sin(-4*t)]];
> t:=2*k*Pi/100;
> plot([m$k=0..100],scaling=constrained,color=green,axes=none,title="pictrue 5-7");
5-8 Construct this design
> restart;
> t:=Pi*n/100;
> x:=cos(t)-1;
>
> y:=sin(t);
> x1:=sqrt(1-(y-1)^2);
> m:=[[x,y],[x,-y],[x1,-y],[x1,y],[x,y]]:
> plot([m$n=1..50],scaling=constrained,axes=none,color=violet);
5-9 Construct the nested squares as thus
> restart;
> m:=[[1,1],[1,-1],[-1,-1],[-1,1],[1,1]];
> w:=[]:
> t:=0.1:
> w:=[op(w),m];
> plot(w,scaling=constrained);
> sm:=[m[2],m[3],m[4],m[1],m[2]];
> for k to 20 do w:=[op(w),m]:sm:=[m[2],m[3],m[4],m[1],m[2]]:m:=(1-t)*m+t*sm: od:
> plot(w,scaling =constrained,title="nested square",color=blue,axes=none);
5-10 Constructed nested triangles as thus:
> restart;
> q:=evalf(Pi/3);
> m:=[[0,0],[1,0],[cos(q),sin(q)],[0,0]];
> w:=[]:
> t:=0.1:
> for k to 20 do w:=[op(w),m]:sm:=[m[2],m[3],m[1],m[2]]:m:=(1-t)*m+t*sm: od:
> plot(w,scaling=constrained,color=gold,title="5-10 nestes triangle",axes=none);
5-11 Construct this pattern
> restart;
> with(plots):
Warning, the name changecoords has been redefined
> q:=evalf(Pi/3);
> m:=[[0,0],[1,0],[cos(q),sin(q)],[0,0]];
>
> w:=[]:
> t:=0.1:
> for k to 20 do w:=[op(w),m]:sm:=[m[2],m[3],m[1],m[2]]:m:=(1-t)*m+t*sm:od:
> a1:=plot(w,axes=none,scaling=constrained,color=red):
> m:=[[0,0],[cos(2*q),sin(2*q)],[cos(q),sin(q)],[0,0]]:
> w:=[]:
> t:=0.1:
> for k to 20 do w:=[op(w),m]:sm:=[m[2],m[3],m[1],m[2]]:m:=(1-t)*m+t*sm:od:
> a2:=plot(w,axes=none,scaling=constrained,color=blue):
> m:=[[0,0],[cos(2*q),sin(2*q)],[cos(3*q),sin(3*q)],[0,0]]:
> w:=[]:
> t:=0.1:
> for k to 20 do w:=[op(w),m]:sm:=[m[2],m[3],m[1],m[2]]:m:=(1-t)*m+t*sm:od:
> a3:=plot(w,axes=none,scaling=constrained,color=blue):
> m:=[[0,0],[cos(4*q),sin(4*q)],[cos(3*q),sin(3*q)],[0,0]]:
> w:=[]:
> t:=0.1:
> for k to 20 do w:=[op(w),m]:sm:=[m[2],m[3],m[1],m[2]]:m:=(1-t)*m+t*sm:od:
> a4:=plot(w,axes=none,scaling=constrained,color=blue):
> m:=[[0,0],[cos(4*q),sin(4*q)],[cos(5*q),sin(5*q)],[0,0]]:
> w:=[]:
> t:=0.1:
> for k to 20 do w:=[op(w),m]:sm:=[m[2],m[3],m[1],m[2]]:m:=(1-t)*m+t*sm:od:
> a5:=plot(w,axes=none,scaling=constrained,color=blue):
> m:=[[0,0],[cos(6*q),sin(6*q)],[cos(5*q),sin(5*q)],[0,0]]:
> w:=[]:
> t:=0.1:
> for k to 20 do w:=[op(w),m]:sm:=[m[2],m[3],m[1],m[2]]:m:=(1-t)*m+t*sm:od:
> a6:=plot(w,axes=none,scaling=constrained,color=blue):
> display(a1,a2,a3,a4,a5,a6);
5-12 Construct the family of ellipses
as t ranges in [0,1]
> restart;
> x:=(1-a)*cos(t);
> y:=a*sin(t);
> a:=k/20:
> m:=[x,y,t=0..2*Pi];
> plot([m$k=0..20],scaling=constrained,color=black,axes=none);
°Ê ±Þ
> restart;
> with(plots);
Warning, the name changecoords has been redefined
> ?animate:
> x:=(1-a)*cos(t):
> y:=a*sin(t):
> a:=k/20
> m:=[x,y,t=0..2*Pi];
> animate(m,k=0..20);
5-13 Construct the concentric and coaxial ellipses of constant area
5-14 Construct this pattern
> restart;
> plot([[x,cos(x)+0.03*n*x*(x-1)*(x-2)*(x-3)*(x-4),x=0..4]$n=0..10],scaling=constrained,axes=none,color=violet);
5-15 Construct this pattern
> restart;
> plot([[x,10*sin(x)/x+n,x=-20..20]$n=0..30],scaling=constrained,axes=none,color=orange);
5-16 Construct the reflections of a light ray trapped inside a reflective ellipse. There are two cases
case1:
> restart;
> with(linalg):
Warning, the protected names norm and trace have been redefined and unprotected
> a:=5:b:=3:r:=2.34:s:=3.5;
> ll:=[a*cos(r),b*sin(r)]:l:=[a*cos(s),b*sin(s)];
> m:=[l,ll];
> for k to 200 do u:=ll-l: n:=[-b*ll[1]/a,-a*ll[2]/b]:v:=u-2*dotprod(u , n)*n/dotprod(n,n):t:=-2*(b^2*v[1]*ll[1]+a^2*ll[2]*v[2])/(b^2*v[1]^2+a^2*v[2]^2):lll:=ll+t*v:m:=[op(m),lll]:l:=ll:ll:=lll:od:
> plot(m,scaling=constrained,axes=none,color=green);
caes2:
> restart;
> with(linalg):
Warning, the protected names norm and trace have been redefined and unprotected
> a:=3:b:=5:r:=2.22:s:=5.1;
> ll:=[a*cos(r),b*sin(r)]:l:=[a*cos(s),b*sin(s)];
> m:=[l,ll];
> for k to 200 do u:=ll-l: n:=[-b*ll[1]/a,-a*ll[2]/b]:v:=u-2*dotprod(u , n)*n/dotprod(n,n):t:=-2*(b^2*v[1]*ll[1]+a^2*ll[2]*v[2])/(b^2*v[1]^2+a^2*v[2]^2):lll:=ll+t*v:m:=[op(m),lll]:l:=ll:ll:=lll:od:
> plot(m,scaling=constrained,axes=none,color=gold);