Question: Reflections of a triangle

Basically, as part of a project we are to use a triangle, reflect the triangle and make it different colours. However I have come across this procedure and REALLY do not understand what it is doing and was wondering if anyone was able to simplify the section in bold in any way!

 

 

Cperm:=proc( L )
proc(Plt)
local LocPlt,OldC,Col,NewCol,SpellCol;
LocPlt := Plt;
for SpellCol in [ COLOR, COLOUR ] do
OldC :=selectfun(Plt,SpellCol);
for Col in OldC do
NewCol := SpellCol(op(1,Col),seq(op(L[j]+1,Col),j=1..3) );
LocPlt := subs( Col=NewCol, LocPlt)
end do;
end do;
return LocPlt
end proc:
end proc:

 

S := Cperm([3,1,2]):
T := Cperm([2,3,1]):
Let's test this:
display( D0, S(s(D0)),T(t(D0)) );
 

 

Thanks very much.

 

Please Wait...