edu.jhu.ece.iacl.jist.algorithms.graphics
Class GeomUtil

java.lang.Object
  extended by edu.jhu.ece.iacl.jist.algorithms.graphics.GeomUtil

public class GeomUtil
extends java.lang.Object

The Class GeomUtil.


Constructor Summary
GeomUtil()
           
 
Method Summary
static double angle(Point3f v0, Point3f v1, Point3f v2)
          Angle.
static double angle(Tuple2d p1, Tuple2d p2)
          Angle.
static double angle(Tuple3f p1, Tuple3f p2)
          Angle.
static Point3f angleBisect(Point3f p1, Point3f p2, Point3f p3)
          Angle bisect.
static double cosAngle(Vector2d v1, Vector2d v2)
          Cos angle.
static double cosAngle(Vector3f v1, Vector3f v2)
          Cos angle.
static double crossProduct(Tuple2d u, Tuple2d v)
          Cross product.
static double determinant(double fX0, double fY0, double fZ0, double fX1, double fY1, double fZ1, double fX2, double fY2, double fZ2)
          Determinant.
static double determinant(double fX0, double fY0, double fZ0, double fW0, double fX1, double fY1, double fZ1, double fW1, double fX2, double fY2, double fZ2, double fW2, double fX3, double fY3, double fZ3, double fW3)
          Determinant.
static double distance(Tuple3d p1, Tuple3d p2)
          Distance.
static double distance(Tuple3f p1, Tuple3d p2)
          Distance.
static double distance(Tuple3f p1, Tuple3f p2)
          Distance.
static double dot(Tuple3d u, Tuple3d v)
          Dot.
static double dot(Tuple3f u, Tuple3f v)
          Dot.
static double fractionalAnisotropy(Matrix m)
          Fractional anisotropy.
static Vector3f interp(Tuple3f v1, Tuple3f v2, double t)
          Interp.
static double intersectionAngle(Vector3f x1, Vector3f x2, Vector3f x3, Vector3f x4)
          Intersection angle.
static double intersectionTime(Tuple2d x1, Tuple2d v1, Tuple2d x2, Tuple2d v2)
          Intersection time.
static Matrix jacobianCartesianToSphere(Point3f q1, Point3f q2, Point3d q3, Point2d p1, Point2d p2, Point2d p3, Point2d p)
          Jacobian cartesian to sphere.
static Matrix jacobianCartesianToStereo(Point3f q1, Point3f q2, Point3d q3, Point2d p1, Point2d p2, Point2d p3)
          Jacobian cartesian to stereo.
static Matrix jacobianSphereToStereo(Point2d p)
          Jacobian sphere to stereo.
static Matrix jacobianStereoToCartesian(Point3f q1, Point3f q2, Point3d q3, Point2d p1, Point2d p2, Point2d p3)
          Jacobian stereo to cartesian.
static Matrix jacobianStereoToSphere(Point2d p)
          Jacobian stereo to sphere.
static double length(Tuple3d p)
          Length.
static double length(Tuple3f p)
          Length.
static double maxStretch(Matrix m)
          Max stretch.
static double meanDiffusivity(Matrix m)
          Mean diffusivity.
static double meanStretch(Matrix m)
          Mean stretch.
static Point3f multMatrix(Matrix3d A, double[] p)
          Mult matrix.
static Point3d multMatrix(Matrix3d A, Point3d p)
          Mult matrix.
static Point3f multMatrix(Matrix3d A, Point3f p)
          Mult matrix.
static Vector3f multMatrix(Matrix3d A, Vector3f p)
          Mult matrix.
static Point3f multMatrix(Matrix A, double[] p)
          Mult matrix.
static Point3f multMatrix(Matrix A, Point3f p)
          Mult matrix.
static Point3d multMatrix3d(Matrix3d A, Point3d p)
          Mult matrix3d.
static Point3d multMatrix3d(Matrix3d A, Point3f p)
          Mult matrix3d.
static void normalize(Tuple3d p1)
          Normalize.
static void normalize(Tuple3f p1)
          Normalize.
static double normalizedAngle(Tuple3f p1, Tuple3f p2)
          Normalized angle.
static void normalizeSqr(Tuple3d p1)
          Normalize sqr.
static void normalizeSqr(Tuple3f p1)
          Normalize sqr.
static int relationToCircumsphere(Point3f P, Point3f V0, Point3f V1, Point3f V2, Point3f V3)
          Relation to circumsphere.
static int relationToPlane(Point3f rkP, Point3f rkV0, Point3f rkV1, Point3f rkV2)
          Relation to plane.
static Matrix rotateInverseMatrix(double theta, double phi)
          Rotate inverse matrix.
static Matrix rotateInverseMatrix(Point3f p)
          Rotate inverse matrix.
static Matrix3d rotateInverseMatrix3d(double theta, double phi)
          Rotate inverse matrix3d.
static Matrix3d rotateInverseMatrix3d(Point3f p)
          Rotate inverse matrix3d.
static Matrix rotateMatrix(double theta, double phi)
          Rotate matrix.
static Matrix3d rotateMatrix3d(double theta, double phi)
          Rotate matrix3d.
static Matrix3f rotateMatrix3f(double theta, double phi)
          Rotate matrix3f.
static Vector2d slerp(Tuple2d v1, Tuple2d v2, double t)
          Slerp.
static Vector3f slerp(Tuple3f v1, Tuple3f v2, double t)
          Slerp.
static Point2d sphereToStereo(Tuple3f p)
          Sphere to stereo.
static double sphericalAngle(Vector3d v2, Vector3d v1, Vector3d v3)
          Spherical angle.
static double sphericalAngle(Vector3f v2, Vector3f v1, Vector3f v3)
          Spherical angle.
static Point3f stereoToSphere(Tuple2d p)
          Stereo to sphere.
static double tanAngle(Tuple3f v0, Tuple3f v1, Tuple3f v2)
          Tan angle.
static Point3f toCartesian(Point2d r)
          To cartesian.
static Point3f toCartesian(Point2f r)
          To cartesian.
static Point3f toCartesian(Point3d r)
          To cartesian.
static Vector3f toCartesianVector(Point2d r)
          To cartesian vector.
static Point3d toSpherical(Tuple3f p)
          To spherical.
static Point2d toUnitSpherical(Tuple3f p)
          To unit spherical.
static double triangleArea(Point3f v0, Point3f v1, Point3f v2)
          Triangle area.
static Point2d[] unwrap(Point3f p1, Point3f p2, Point3f p3)
          Unwrap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeomUtil

public GeomUtil()
Method Detail

rotateInverseMatrix

public static Matrix rotateInverseMatrix(Point3f p)
Rotate inverse matrix.

Parameters:
p - the p
Returns:
the matrix

length

public static double length(Tuple3f p)
Length.

Parameters:
p - the p
Returns:
the double

length

public static double length(Tuple3d p)
Length.

Parameters:
p - the p
Returns:
the double

distance

public static double distance(Tuple3f p1,
                              Tuple3f p2)
Distance.

Parameters:
p1 - the p1
p2 - the p2
Returns:
the double

distance

public static double distance(Tuple3f p1,
                              Tuple3d p2)
Distance.

Parameters:
p1 - the p1
p2 - the p2
Returns:
the double

distance

public static double distance(Tuple3d p1,
                              Tuple3d p2)
Distance.

Parameters:
p1 - the p1
p2 - the p2
Returns:
the double

rotateInverseMatrix

public static Matrix rotateInverseMatrix(double theta,
                                         double phi)
Rotate inverse matrix.

Parameters:
theta - the theta
phi - the phi
Returns:
the matrix

rotateInverseMatrix3d

public static Matrix3d rotateInverseMatrix3d(Point3f p)
Rotate inverse matrix3d.

Parameters:
p - the p
Returns:
the matrix3d

rotateInverseMatrix3d

public static Matrix3d rotateInverseMatrix3d(double theta,
                                             double phi)
Rotate inverse matrix3d.

Parameters:
theta - the theta
phi - the phi
Returns:
the matrix3d

multMatrix

public static Point3f multMatrix(Matrix A,
                                 Point3f p)
Mult matrix.

Parameters:
A - the a
p - the p
Returns:
the point3f

multMatrix

public static Point3f multMatrix(Matrix A,
                                 double[] p)
Mult matrix.

Parameters:
A - the a
p - the p
Returns:
the point3f

multMatrix

public static Point3f multMatrix(Matrix3d A,
                                 double[] p)
Mult matrix.

Parameters:
A - the a
p - the p
Returns:
the point3f

multMatrix3d

public static Point3d multMatrix3d(Matrix3d A,
                                   Point3f p)
Mult matrix3d.

Parameters:
A - the a
p - the p
Returns:
the point3d

multMatrix3d

public static Point3d multMatrix3d(Matrix3d A,
                                   Point3d p)
Mult matrix3d.

Parameters:
A - the a
p - the p
Returns:
the point3d

multMatrix

public static Point3f multMatrix(Matrix3d A,
                                 Point3f p)
Mult matrix.

Parameters:
A - the a
p - the p
Returns:
the point3f

multMatrix

public static Vector3f multMatrix(Matrix3d A,
                                  Vector3f p)
Mult matrix.

Parameters:
A - the a
p - the p
Returns:
the vector3f

sphereToStereo

public static Point2d sphereToStereo(Tuple3f p)
Sphere to stereo.

Parameters:
p - the p
Returns:
the point2d

stereoToSphere

public static Point3f stereoToSphere(Tuple2d p)
Stereo to sphere.

Parameters:
p - the p
Returns:
the point3f

multMatrix

public static Point3d multMatrix(Matrix3d A,
                                 Point3d p)
Mult matrix.

Parameters:
A - the a
p - the p
Returns:
the point3d

toUnitSpherical

public static Point2d toUnitSpherical(Tuple3f p)
To unit spherical.

Parameters:
p - the p
Returns:
the point2d

toSpherical

public static Point3d toSpherical(Tuple3f p)
To spherical.

Parameters:
p - the p
Returns:
the point3d

toCartesian

public static Point3f toCartesian(Point2d r)
To cartesian.

Parameters:
r - the r
Returns:
the point3f

toCartesian

public static Point3f toCartesian(Point3d r)
To cartesian.

Parameters:
r - the r
Returns:
the point3f

toCartesian

public static Point3f toCartesian(Point2f r)
To cartesian.

Parameters:
r - the r
Returns:
the point3f

normalizedAngle

public static double normalizedAngle(Tuple3f p1,
                                     Tuple3f p2)
Normalized angle.

Parameters:
p1 - the p1
p2 - the p2
Returns:
the double

normalize

public static void normalize(Tuple3f p1)
Normalize.

Parameters:
p1 - the p1

normalize

public static void normalize(Tuple3d p1)
Normalize.

Parameters:
p1 - the p1

normalizeSqr

public static void normalizeSqr(Tuple3f p1)
Normalize sqr.

Parameters:
p1 - the p1

normalizeSqr

public static void normalizeSqr(Tuple3d p1)
Normalize sqr.

Parameters:
p1 - the p1

angle

public static double angle(Tuple3f p1,
                           Tuple3f p2)
Angle.

Parameters:
p1 - the p1
p2 - the p2
Returns:
the double

angle

public static double angle(Tuple2d p1,
                           Tuple2d p2)
Angle.

Parameters:
p1 - the p1
p2 - the p2
Returns:
the double

sphericalAngle

public static double sphericalAngle(Vector3d v2,
                                    Vector3d v1,
                                    Vector3d v3)
Spherical angle.

Parameters:
v2 - the v2
v1 - the v1
v3 - the v3
Returns:
the double

sphericalAngle

public static double sphericalAngle(Vector3f v2,
                                    Vector3f v1,
                                    Vector3f v3)
Spherical angle.

Parameters:
v2 - the v2
v1 - the v1
v3 - the v3
Returns:
the double

toCartesianVector

public static Vector3f toCartesianVector(Point2d r)
To cartesian vector.

Parameters:
r - the r
Returns:
the vector3f

rotateMatrix

public static Matrix rotateMatrix(double theta,
                                  double phi)
Rotate matrix.

Parameters:
theta - the theta
phi - the phi
Returns:
the matrix

rotateMatrix3d

public static Matrix3d rotateMatrix3d(double theta,
                                      double phi)
Rotate matrix3d.

Parameters:
theta - the theta
phi - the phi
Returns:
the matrix3d

rotateMatrix3f

public static Matrix3f rotateMatrix3f(double theta,
                                      double phi)
Rotate matrix3f.

Parameters:
theta - the theta
phi - the phi
Returns:
the matrix3f

slerp

public static Vector3f slerp(Tuple3f v1,
                             Tuple3f v2,
                             double t)
Slerp.

Parameters:
v1 - the v1
v2 - the v2
t - the t
Returns:
the vector3f

interp

public static Vector3f interp(Tuple3f v1,
                              Tuple3f v2,
                              double t)
Interp.

Parameters:
v1 - the v1
v2 - the v2
t - the t
Returns:
the vector3f

slerp

public static Vector2d slerp(Tuple2d v1,
                             Tuple2d v2,
                             double t)
Slerp.

Parameters:
v1 - the v1
v2 - the v2
t - the t
Returns:
the vector2d

unwrap

public static Point2d[] unwrap(Point3f p1,
                               Point3f p2,
                               Point3f p3)
Unwrap.

Parameters:
p1 - the p1
p2 - the p2
p3 - the p3
Returns:
the point2d[]

angle

public static double angle(Point3f v0,
                           Point3f v1,
                           Point3f v2)
Angle.

Parameters:
v0 - the v0
v1 - the v1
v2 - the v2
Returns:
the double

angleBisect

public static Point3f angleBisect(Point3f p1,
                                  Point3f p2,
                                  Point3f p3)
Angle bisect.

Parameters:
p1 - the p1
p2 - the p2
p3 - the p3
Returns:
the point3f

intersectionTime

public static double intersectionTime(Tuple2d x1,
                                      Tuple2d v1,
                                      Tuple2d x2,
                                      Tuple2d v2)
Intersection time.

Parameters:
x1 - the x1
v1 - the v1
x2 - the x2
v2 - the v2
Returns:
the double

intersectionAngle

public static double intersectionAngle(Vector3f x1,
                                       Vector3f x2,
                                       Vector3f x3,
                                       Vector3f x4)
Intersection angle.

Parameters:
x1 - the x1
x2 - the x2
x3 - the x3
x4 - the x4
Returns:
the double

triangleArea

public static double triangleArea(Point3f v0,
                                  Point3f v1,
                                  Point3f v2)
Triangle area.

Parameters:
v0 - the v0
v1 - the v1
v2 - the v2
Returns:
the double

tanAngle

public static double tanAngle(Tuple3f v0,
                              Tuple3f v1,
                              Tuple3f v2)
Tan angle.

Parameters:
v0 - the v0
v1 - the v1
v2 - the v2
Returns:
the double

crossProduct

public static double crossProduct(Tuple2d u,
                                  Tuple2d v)
Cross product.

Parameters:
u - the u
v - the v
Returns:
the double

dot

public static double dot(Tuple3d u,
                         Tuple3d v)
Dot.

Parameters:
u - the u
v - the v
Returns:
the double

dot

public static double dot(Tuple3f u,
                         Tuple3f v)
Dot.

Parameters:
u - the u
v - the v
Returns:
the double

cosAngle

public static double cosAngle(Vector3f v1,
                              Vector3f v2)
Cos angle.

Parameters:
v1 - the v1
v2 - the v2
Returns:
the double

cosAngle

public static double cosAngle(Vector2d v1,
                              Vector2d v2)
Cos angle.

Parameters:
v1 - the v1
v2 - the v2
Returns:
the double

jacobianStereoToCartesian

public static Matrix jacobianStereoToCartesian(Point3f q1,
                                               Point3f q2,
                                               Point3d q3,
                                               Point2d p1,
                                               Point2d p2,
                                               Point2d p3)
Jacobian stereo to cartesian.

Parameters:
q1 - the q1
q2 - the q2
q3 - the q3
p1 - the p1
p2 - the p2
p3 - the p3
Returns:
the matrix

jacobianStereoToSphere

public static Matrix jacobianStereoToSphere(Point2d p)
Jacobian stereo to sphere.

Parameters:
p - the p
Returns:
the matrix

jacobianSphereToStereo

public static Matrix jacobianSphereToStereo(Point2d p)
Jacobian sphere to stereo.

Parameters:
p - the p
Returns:
the matrix

jacobianCartesianToSphere

public static Matrix jacobianCartesianToSphere(Point3f q1,
                                               Point3f q2,
                                               Point3d q3,
                                               Point2d p1,
                                               Point2d p2,
                                               Point2d p3,
                                               Point2d p)
Jacobian cartesian to sphere.

Parameters:
q1 - the q1
q2 - the q2
q3 - the q3
p1 - the p1
p2 - the p2
p3 - the p3
p - the p
Returns:
the matrix

fractionalAnisotropy

public static double fractionalAnisotropy(Matrix m)
Fractional anisotropy.

Parameters:
m - the m
Returns:
the double

meanDiffusivity

public static double meanDiffusivity(Matrix m)
Mean diffusivity.

Parameters:
m - the m
Returns:
the double

meanStretch

public static double meanStretch(Matrix m)
Mean stretch.

Parameters:
m - the m
Returns:
the double

maxStretch

public static double maxStretch(Matrix m)
Max stretch.

Parameters:
m - the m
Returns:
the double

jacobianCartesianToStereo

public static Matrix jacobianCartesianToStereo(Point3f q1,
                                               Point3f q2,
                                               Point3d q3,
                                               Point2d p1,
                                               Point2d p2,
                                               Point2d p3)
Jacobian cartesian to stereo.

Parameters:
q1 - the q1
q2 - the q2
q3 - the q3
p1 - the p1
p2 - the p2
p3 - the p3
Returns:
the matrix

determinant

public static double determinant(double fX0,
                                 double fY0,
                                 double fZ0,
                                 double fW0,
                                 double fX1,
                                 double fY1,
                                 double fZ1,
                                 double fW1,
                                 double fX2,
                                 double fY2,
                                 double fZ2,
                                 double fW2,
                                 double fX3,
                                 double fY3,
                                 double fZ3,
                                 double fW3)
Determinant.

Parameters:
fX0 - the f x0
fY0 - the f y0
fZ0 - the f z0
fW0 - the f w0
fX1 - the f x1
fY1 - the f y1
fZ1 - the f z1
fW1 - the f w1
fX2 - the f x2
fY2 - the f y2
fZ2 - the f z2
fW2 - the f w2
fX3 - the f x3
fY3 - the f y3
fZ3 - the f z3
fW3 - the f w3
Returns:
the double

determinant

public static double determinant(double fX0,
                                 double fY0,
                                 double fZ0,
                                 double fX1,
                                 double fY1,
                                 double fZ1,
                                 double fX2,
                                 double fY2,
                                 double fZ2)
Determinant.

Parameters:
fX0 - the f x0
fY0 - the f y0
fZ0 - the f z0
fX1 - the f x1
fY1 - the f y1
fZ1 - the f z1
fX2 - the f x2
fY2 - the f y2
fZ2 - the f z2
Returns:
the double

relationToCircumsphere

public static int relationToCircumsphere(Point3f P,
                                         Point3f V0,
                                         Point3f V1,
                                         Point3f V2,
                                         Point3f V3)
Relation to circumsphere.

Parameters:
P - the p
V0 - the v0
V1 - the v1
V2 - the v2
V3 - the v3
Returns:
the int

relationToPlane

public static int relationToPlane(Point3f rkP,
                                  Point3f rkV0,
                                  Point3f rkV1,
                                  Point3f rkV2)
Relation to plane.

Parameters:
rkP - the rk p
rkV0 - the rk v0
rkV1 - the rk v1
rkV2 - the rk v2
Returns:
the int