1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
// rotate.cmd
// Surface Evolver procedure to rotate unfixed vertices by angle about z axis.
// Programmer: Ken Brakke, brakke@susqu.edu, http://www.susqu.edu/brakke
// Usage: rotate(angle)
// where angle is in radians.
procedure rotate(real roth) {
local sss,ccc,rrad,oldx;
sss := sin(roth); ccc := cos(roth);
foreach vertex vv where not fixed do
{ rrad := vv.x^2+vv.y^2;
oldx := vv.x;
set vv x vv.x*ccc-vv.y*sss;
set vv y oldx*sss+vv.y*ccc;
}
}
// End rotate.cmd
// Usage: rotate(angle)
// where angle is in radians.
|