public class QuadraticUtilsTest extends UnitTest
Constructor and Description |
---|
QuadraticUtilsTest() |
Modifier and Type | Method and Description |
---|---|
double |
clipDratio(double a,
double b,
double dratio) |
static double |
ellipsoidPenetrationDistanceOmar(Vector3d nrm,
Vector3d pos,
Vector3d p0,
double a,
double b,
double c,
double tol,
IntHolder numIters,
boolean debug)
Alternative implementation of ellipsoidPenetrationDistance() written by
Omar Zarifi.
|
static void |
main(java.lang.String[] args) |
void |
sphereSurfaceTangent(Point3d pr,
Point3d p0,
Point3d p1,
double r) |
void |
test() |
void |
testEllipseDist(double a,
double b,
double theta,
double dratio)
Test nearestPointEllipse() for an ellipse with minor axis lengths
a and b . |
void |
testEllipseDist(double a,
double b,
double p0x,
double p0y,
double pnx,
double pny) |
void |
testEllipseDistance()
Test nearestPointEllipse()
|
void |
testEllipsoidDist(double a,
double b,
double c,
double theta,
double phi,
double dratio)
Test nearestPointEllipsoid() for an ellipsoid with minor axis lengths
a , b , and c . |
void |
testEllipsoidDistance()
Test nearestPointEllipsoid()
|
void |
testEllipsoidPenetrationDistance(boolean printInfo) |
void |
testEllipsoidSurfaceTangent() |
void |
timeEllipsoidEberly(double a,
double b,
double c,
int numtests) |
void |
timeEllipsoidLloyd(double a,
double b,
double c,
int numtests) |
check, checkEquals, checkEquals, checkEquals, checkEquals, checkEquals, checkEquals, checkEquals, checkEquals, checkNormedEquals, checkNormedEquals, getSilent, printUsageAndExit, runtest, setSilent
public static double ellipsoidPenetrationDistanceOmar(Vector3d nrm, Vector3d pos, Vector3d p0, double a, double b, double c, double tol, IntHolder numIters, boolean debug)
public void testEllipsoidSurfaceTangent()
public void testEllipsoidPenetrationDistance(boolean printInfo)
public void testEllipseDist(double a, double b, double theta, double dratio)
a
and b
. This method works in reverse, by
starting with a point pchk
on the ellipse defined by the
parametric coordinate theta
, and then
finding a query point q
for which pchk
is the
nearest point. q
is
determined by moving away from pchk
along the direction of
the curve normal nrm
at pchk
by a distance
dchk
, such that
q = pchk + dchk * nrm.
dchk
is determined from
dchk = dratio * ndistwhere
ndist
is the distance along the normal from
pchk
to the boundary of its quadrant. In cases
where pchk
lies on the x or y axis,
and the resulting q
is inside the ellipse
(i.e., dratio <
0), it may be necessary to futher restrict
dchk
.
Given q
and dchk
, this method
then verifies that
d = nearestPointEllipse (p, a, b, q);returns
d
and p
values that match
dchk
and pchk
.public void testEllipseDist(double a, double b, double p0x, double p0y, double pnx, double pny)
public void testEllipseDistance()
public double clipDratio(double a, double b, double dratio)
public void testEllipsoidDist(double a, double b, double c, double theta, double phi, double dratio)
a
, b
, and c
. This method works in
reverse, by starting with a point pchk
on the ellipsoid
defined by the parametric coordinates theta
andphi
, and then finding a query point q
for
which pchk
is the nearest point. q
is
determined by moving away from pchk
along the direction of
the surface normal nrm
at pchk
by a distance
dchk
, such that
q = pchk + dchk * nrm.
dchk
is determined from
dchk = dratio * ndistwhere
ndist
is the distance along the normal from
pchk
to the boundary of its octant. In cases
where pchk
lies on the x/y, y/z or z/x planes
and the resulting q
is inside the ellipsoid (i.e.,
dratio <
0), it may be necessary to futher
restrict dchk
.
Given q
and dchk
, this method
then verifies that
d = nearestPointEllipsoid (p, a, b, c, q);returns
d
and p
values that match
dchk
and pchk
.public void timeEllipsoidEberly(double a, double b, double c, int numtests)
public void timeEllipsoidLloyd(double a, double b, double c, int numtests)
public void testEllipsoidDistance()
public static void main(java.lang.String[] args)