jpview.ptms
Class HPNormals

java.lang.Object
  extended by jpview.ptms.HPNormals

public class HPNormals
extends java.lang.Object

Original code by Hans Wolters Java port by Cliff Lyon


Field Summary
static double eps
          epsilon value - same as zerotol
static double zerotol
          zero tolerance - float close to zero
 
Constructor Summary
HPNormals()
           
 
Method Summary
static int computeMaximumOnCircle(double[] a, double[] normal)
          Finds the maximum value for a normal on the circle for the given array of coefficients and adjusts normal
static double evalPoly(double[] a, double t)
          Evaluate a polynomial for a given set of coefficients
static Vec3f[] getNormals(LRGBPTM ptm)
          Returns "fixed" normals for corner cases in the PTM
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

zerotol

public static final double zerotol
zero tolerance - float close to zero

See Also:
Constant Field Values

eps

public static final double eps
epsilon value - same as zerotol

See Also:
Constant Field Values
Constructor Detail

HPNormals

public HPNormals()
Method Detail

evalPoly

public static double evalPoly(double[] a,
                              double t)
Evaluate a polynomial for a given set of coefficients

Parameters:
a - the coefficient array
t - one of the roots of the polynomial
Returns:
the result of the evaluation

computeMaximumOnCircle

public static int computeMaximumOnCircle(double[] a,
                                         double[] normal)
Finds the maximum value for a normal on the circle for the given array of coefficients and adjusts normal

Parameters:
a - array of coefficients
normal - normal for the point
Returns:
1 if roots were found and normal was adjusted, otherwise -1

getNormals

public static Vec3f[] getNormals(LRGBPTM ptm)
Returns "fixed" normals for corner cases in the PTM

Parameters:
ptm - the source ptm
Returns:
the adjusted array of Vec3f normals