File: rotate.cmd

package info (click to toggle)
evolver 2.70+ds-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 17,148 kB
  • sloc: ansic: 127,395; makefile: 209; sh: 98
file content (23 lines) | stat: -rw-r--r-- 575 bytes parent folder | download | duplicates (2)
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.