com.sun.j3d.utils.geometry
Class Numerics

java.lang.Object
  extended by com.sun.j3d.utils.geometry.Numerics

 class Numerics
extends java.lang.Object


Constructor Summary
Numerics()
           
 
Method Summary
(package private) static double angle(Triangulator triRef, Point2f p, Point2f p1, Point2f p2)
          computes the signed angle between p, p1 and p, p2.
(package private) static double baseLength(Tuple2f u, Tuple2f v)
           
(package private) static boolean eq(double a, double eps)
           
(package private) static boolean ge(double a, double eps)
           
(package private) static double getRatio(Triangulator triRef, int i, int j, int k)
          this function computes a quality measure of a triangle i, j, k.
(package private) static boolean gt(double a, double eps)
           
(package private) static boolean inBetween(int i1, int i2, int i3)
          This checks whether i3, which is collinear with i1, i2, is between i1, i2.
(package private) static int isConvexAngle(Triangulator triRef, int i, int j, int k, int ind)
          Returns convex angle flag.
(package private) static boolean isInCone(Triangulator triRef, int i, int j, int k, int l, boolean convex)
          This method checks whether l is in the cone defined by i, j and j, k
(package private) static boolean le(double a, double eps)
           
(package private) static boolean lt(double a, double eps)
           
(package private) static double max3(double a, double b, double c)
           
(package private) static double min3(double a, double b, double c)
           
(package private) static int orientation(Triangulator triRef, int i, int j, int k)
          Returns the orientation of the triangle.
(package private) static boolean pntInTriangle(Triangulator triRef, int i1, int i2, int i3, int i4)
          This method checks whether point i4 is inside of or on the boundary of the triangle i1, i2, i3.
(package private) static int recSpikeAngle(Triangulator triRef, int i1, int i2, int i3, int ind1, int ind3)
           
(package private) static boolean segIntersect(Triangulator triRef, int i1, int i2, int i3, int i4, int i5)
          Checks whether the line segments i1, i2 and i3, i4 intersect.
(package private) static double sideLength(Tuple2f u, Tuple2f v)
           
(package private) static int spikeAngle(Triangulator triRef, int i, int j, int k, int ind)
           
(package private) static double stableDet2D(Triangulator triRef, int i, int j, int k)
          this method computes the determinant det(points[i],points[j],points[k]) in a consistent way.
(package private) static boolean strictlyInBetween(int i1, int i2, int i3)
           
(package private) static boolean vtxInTriangle(Triangulator triRef, int i1, int i2, int i3, int i4, int[] type)
          This method checks whether point i4 is inside of or on the boundary of the triangle i1, i2, i3.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Numerics

Numerics()
Method Detail

max3

static double max3(double a,
                   double b,
                   double c)

min3

static double min3(double a,
                   double b,
                   double c)

lt

static boolean lt(double a,
                  double eps)

le

static boolean le(double a,
                  double eps)

ge

static boolean ge(double a,
                  double eps)

eq

static boolean eq(double a,
                  double eps)

gt

static boolean gt(double a,
                  double eps)

baseLength

static double baseLength(Tuple2f u,
                         Tuple2f v)

sideLength

static double sideLength(Tuple2f u,
                         Tuple2f v)

inBetween

static boolean inBetween(int i1,
                         int i2,
                         int i3)
This checks whether i3, which is collinear with i1, i2, is between i1, i2. note that we rely on the lexicographic sorting of the points!


strictlyInBetween

static boolean strictlyInBetween(int i1,
                                 int i2,
                                 int i3)

stableDet2D

static double stableDet2D(Triangulator triRef,
                          int i,
                          int j,
                          int k)
this method computes the determinant det(points[i],points[j],points[k]) in a consistent way.


orientation

static int orientation(Triangulator triRef,
                       int i,
                       int j,
                       int k)
Returns the orientation of the triangle.

Returns:
+1 if the points i, j, k are given in CCW order; -1 if the points i, j, k are given in CW order; 0 if the points i, j, k are collinear.

isInCone

static boolean isInCone(Triangulator triRef,
                        int i,
                        int j,
                        int k,
                        int l,
                        boolean convex)
This method checks whether l is in the cone defined by i, j and j, k


isConvexAngle

static int isConvexAngle(Triangulator triRef,
                         int i,
                         int j,
                         int k,
                         int ind)
Returns convex angle flag.

Returns:
0 ... if angle is 180 degrees
1 ... if angle between 0 and 180 degrees
2 ... if angle is 0 degrees
-1 ... if angle between 180 and 360 degrees
-2 ... if angle is 360 degrees

pntInTriangle

static boolean pntInTriangle(Triangulator triRef,
                             int i1,
                             int i2,
                             int i3,
                             int i4)
This method checks whether point i4 is inside of or on the boundary of the triangle i1, i2, i3.


vtxInTriangle

static boolean vtxInTriangle(Triangulator triRef,
                             int i1,
                             int i2,
                             int i3,
                             int i4,
                             int[] type)
This method checks whether point i4 is inside of or on the boundary of the triangle i1, i2, i3. it also returns a classification if i4 is on the boundary of the triangle (except for the edge i2, i3).


segIntersect

static boolean segIntersect(Triangulator triRef,
                            int i1,
                            int i2,
                            int i3,
                            int i4,
                            int i5)
Checks whether the line segments i1, i2 and i3, i4 intersect. no intersection is reported if they intersect at a common vertex. the function assumes that i1 <= i2 and i3 <= i4. if i3 or i4 lies on i1, i2 then an intersection is reported, but no intersection is reported if i1 or i2 lies on i3, i4. this function is not symmetric!


getRatio

static double getRatio(Triangulator triRef,
                       int i,
                       int j,
                       int k)
this function computes a quality measure of a triangle i, j, k. it returns the ratio `base / height', where base is the length of the longest side of the triangle, and height is the normal distance between the vertex opposite of the base side and the base side. (as usual, we again use the l1-norm for distances.)


spikeAngle

static int spikeAngle(Triangulator triRef,
                      int i,
                      int j,
                      int k,
                      int ind)

recSpikeAngle

static int recSpikeAngle(Triangulator triRef,
                         int i1,
                         int i2,
                         int i3,
                         int ind1,
                         int ind3)

angle

static double angle(Triangulator triRef,
                    Point2f p,
                    Point2f p1,
                    Point2f p2)
computes the signed angle between p, p1 and p, p2. warning: this function does not handle a 180-degree angle correctly! (this is no issue in our application, as we will always compute the angle centered at the mid-point of a valid diagonal.)



Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.