[go: up one dir, main page]

File: cir_ck.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 (13 lines) | stat: -rw-r--r-- 344 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "cp_types.h"
#include "cp_proto.h"

/* return 1 if circle approximately hits box. Needs more work. */

int cir_ck(complex ctr,double rad,Box box) 
{
  double lx,ly,rx,ry;

  lx =box.lx-rad; ly =box.ly-rad; rx=box.rx+rad;  ry=box.ry+rad;
  if (ctr.re>lx && ctr.re<rx && ctr.im>ly && ctr.im<ry) return 1;
  else return 0;
} /* cir_ck */