[go: up one dir, main page]

File: rotate.c

package info (click to toggle)
circlepack 5.1-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, sarge
  • size: 2,828 kB
  • ctags: 1,683
  • sloc: ansic: 43,152; makefile: 46
file content (26 lines) | stat: -rw-r--r-- 456 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "cp_types.h"
#include "cp_proto.h"

/* rotate pack p by angle ang (radians). */

int rotate(struct p_data *p,double ang)
{
  int i;
  struct R_data *pR_ptr;
	
  if (p->hes > 0) /* spherical? */
    {
      sprintf(msgbuf,"Rotate spherical packings using 'sph_view'.");
      emsg();
      return 0;
    }
  pR_ptr=p->packR_ptr;
  for (i=1;i<=p->nodecount;i++)
    pR_ptr[i].center=mob_rotate(pR_ptr[i].center,ang);
  return 1;
} /* rotate */