jpview.graphics
Class GraphicsGems

java.lang.Object
  extended by jpview.graphics.GraphicsGems

public class GraphicsGems
extends java.lang.Object

Adopted from GraphicsGems root finders

Author:
Jochen Schwarze (schwarze@isa.de), adpated by cliff lyon

Field Summary
static double EQN_EPS
          epsilon value
 
Constructor Summary
GraphicsGems()
          Creates a new instance of GraphicsGems
 
Method Summary
static double cbrt(double x)
          Returns the cube root
static boolean IsZero(double x)
          true if x is zero w/in tolerance
static int SolveCubic(double[] c, double[] s)
          Solve a cubic equation
static int SolveQuadric(double[] c, double[] s)
          Solves a quadric equation
static int SolveQuadric(double[] c, double[] s, int n)
          Solve a quadric equation
static int SolveQuartic(double[] c, double[] s)
          Solves a quartic equation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EQN_EPS

public static final double EQN_EPS
epsilon value

See Also:
Constant Field Values
Constructor Detail

GraphicsGems

public GraphicsGems()
Creates a new instance of GraphicsGems

Method Detail

IsZero

public static boolean IsZero(double x)
true if x is zero w/in tolerance

Parameters:
x - value to test
Returns:
true if this value is zero

cbrt

public static double cbrt(double x)
Returns the cube root

Parameters:
x - the input value
Returns:
the cube root of the input

SolveQuadric

public static int SolveQuadric(double[] c,
                               double[] s)
Solves a quadric equation

Parameters:
c - The coefficients for the equation
s - Storage for the roots of the equation
Returns:
the number of roots in the equation

SolveQuadric

public static int SolveQuadric(double[] c,
                               double[] s,
                               int n)
Solve a quadric equation

Parameters:
c - coefficient array for the quadric
s - storage for the roots of the equation
n - offset into the result array, if non-zero
Returns:
the number of roots of the equation

SolveCubic

public static int SolveCubic(double[] c,
                             double[] s)
Solve a cubic equation

Parameters:
c - array of coefficients
s - storage for the results
Returns:
the number of roots in the equation

SolveQuartic

public static int SolveQuartic(double[] c,
                               double[] s)
Solves a quartic equation

Parameters:
c - array containing the coefficients of the equation
s - storage for results
Returns:
the number of roots of the equation