[go: up one dir, main page]

File: curv_aim_error.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 (20 lines) | stat: -rw-r--r-- 442 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
#include "cp_types.h"
#include "cp_proto.h"

/* find error in curvatures compared to their targets;
disregard vertices which are free (aim<0). */

double curv_aim_error(struct p_data *p)
{
  int i;
  double accum=0,err;
  struct R_data *pR_ptr;

  pR_ptr=p->packR_ptr;
  for (i=1;i<=p->nodecount;i++) if (pR_ptr[i].aim>=0)
    {
      err=pR_ptr[i].curv-pR_ptr[i].aim;
      accum += fabs(err);
    }
  return (accum);
} /* curv_aim_error */