Michielvsb

15 Reputation

4 Badges

10 years, 328 days

MaplePrimes Activity


These are replies submitted by Michielvsb

@Carl Love That did the job. Thank you very much!

@Carl Love Thank you very much Carl Love!!! It works fine!

@Carl Love Thank you for your response.

restart:with(linalg):with(LinearAlgebra):with(VectorCalculus):with(plots): interface(rtablesize= infinity); 10 eerste:=proc(V,N,P) local M,M1,M2,I4,NT; NT:=Transpose(N); M1:=V.NT; I4:=IdentityMatrix(4); M2:=(N.V).I4; M:=M1-M2; M.P; end proc: tweede:=proc(OS,r,s,P1) local VC,K: K:=Matrix(4,3,[r,s,OS]); VC:=(MatrixInverse(Transpose(K).K)).Transpose(K); VC.P1; end proc: project:=proc(P,V,N,OS,r,s) local P1,P2,i,j,n: P1:=eerste(V,N,P); P2:=tweede(OS,r,s,P1); n:=ColumnDimension(P2); for i from 1 to n do for j from 1 to 2 do P2[j,i]:=P2[j,i]/P2[3,i]; end do: end do: DeleteRow(P2,3); end proc: P:=Matrix([[ 0 , 10 , 10 , 0 , 0 , 10 , 10 , 0 , 5 ], [ 0 , 0 , 10 , 10 , 0 , 0 , 10 , 10 , 5 ], [ 0 , 0 , 0 , 0 , 30 , 30 , 30 , 30 , 40 ], [ 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ]]): V:=Vector([60,60,50,1]); N:=Vector([1,0,0,0]); OS:=Vector([10,10,0,1]); r:=Vector([0,1,0,0]); s:=Vector([0,0,1,0]); translatie:=t->Matrix([[ 1 , 0 , 0 , 1*t ], [ 0 , 1 , 0 , 1*t ], [ 0 , 0 , 1 , 0 ], [ 0 , 0 , 0 , 1 ]]); f:=proc(t) local volgende,res,vlak_onder,vlak_links,vlak_voor,vlak_rechts,vlak_boven,vlak_achter,vlak1,vlak2,vlak3,vlak4,pp1,pp2,pp3,pp4,pp5,pp6,pp7,pp8,pp9,pp10: volgende:=MatrixMatrixMultiply(translatie(t),P): res:=project(volgende,V,N,OS,r,s): vlak_onder :=Transpose(Matrix([Column(res,1),Column(res,2),Column(res,3),Column(res,4)])): vlak_links :=Transpose(Matrix([Column(res,1),Column(res,2),Column(res,6),Column(res,5)])): vlak_voor :=Transpose(Matrix([Column(res,2),Column(res,3),Column(res,7),Column(res,6)])): vlak_rechts:=Transpose(Matrix([Column(res,3),Column(res,4),Column(res,8),Column(res,7)])): vlak_achter:=Transpose(Matrix([Column(res,1),Column(res,4),Column(res,8),Column(res,5)])): vlak_boven :=Transpose(Matrix([Column(res,5),Column(res,6),Column(res,7),Column(res,8)])): vlak1:=Transpose(Matrix([Column(res,8),Column(res,7),Column(res,9)])): vlak2:=Transpose(Matrix([Column(res,8),Column(res,7),Column(res,9)])); vlak3:=Transpose(Matrix([Column(res,8),Column(res,5),Column(res,9)])); vlak4:=Transpose(Matrix([Column(res,5),Column(res,6),Column(res,9)])); pp1:=polygonplot(vlak_onder): pp2:=polygonplot(vlak_links): pp3:=polygonplot(vlak_voor): pp4:=polygonplot(vlak_rechts): pp5:=polygonplot(vlak_achter): pp6:=polygonplot(vlak_boven); pp7:=polygonplot(vlak1); pp8:=polygonplot(vlak2); pp9:=polygonplot(vlak3); pp10:=polygonplot(vlak4); {pp1,pp2,pp3,pp4,pp5,pp6,pp7,pp8,pp9,pp10}: end proc: display(f(0),scaling=constrained);

 

Here is a link to the file:

vraag.mw

Page 1 of 1