[go: up one dir, main page]

File: set_radius.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-- 514 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"

double radius(struct p_data *p,int v)
     /* give radius. In hyp case, converts s-rad to usual hyp rad.  */
{
  if ( (p->hes<0) && (p->packR_ptr[v].rad > 0) ) 
    return (-log(p->packR_ptr[v].rad));
  return (p->packR_ptr[v].rad);
} /* radius */

double radius_pl(struct p_light *pl,int v)
     /* same, but for p_light data */
{
  double rad;

  if ((pl->counts[1]<0) && ((rad=pl->radii[v]) > 0.0))
    return (-log(rad));
  return (pl->radii[v]);
} /* radius_pl */