APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.badlogic.gdx.math

public Class ShewchukExactPredicates

extends Object
Class Inheritance

Based on Jonathan Richard Shewchuk, "Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric Predicates" (Discrete & Computational Geometry 18(3):305-363, 1997). Java port of mourner/robust-predicates v3.0.3.

orient2d, orient3d, incircle and insphere return a double whose sign is exact; the *fast variants are faster non-robust approximations.

Not thread-safe. Each instance lazily allocates and reuses internal scratch buffers; once every predicate has been exercised an instance retains roughly 284 KiB of them (dominated by insphere).

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final double
private static final double
private static final double
private static final double
private ShewchukExactPredicates.InsphereAdaptScratch
private ShewchukExactPredicates.IncircleScratch
private static final double
private static final double
private static final double
private ShewchukExactPredicates.InsphereExactScratch
private static final double
private static final double
private static final double
private ShewchukExactPredicates.LiftAdaptScratch
private ShewchukExactPredicates.LiftExactScratch
private ShewchukExactPredicates.O2Scratch
private ShewchukExactPredicates.O3Scratch
private static final double
private static final double
private static final double
private static final double
private ShewchukExactPredicates.SumThreeScratch
private static final double

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static double
crossProduct(double a, double b, double c, double d, double[] D)

private static double
estimate(int elen, double[] e)

public double
incircle(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy)

2D in-circle test.

private double
incircleadapt(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy, double permanent)

public double
incirclefast(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy)

Non-robust counterpart of incircle; the sign may be wrong on near-degenerate inputs.

public double
insphere(double ax, double ay, double az, double bx, double by, double bz, double cx, double cy, double cz, double dx, double dy, double dz, double ex, double ey, double ez)

3D in-sphere test.

private double
insphereadapt(double ax, double ay, double az, double bx, double by, double bz, double cx, double cy, double cz, double dx, double dy, double dz, double ex, double ey, double ez, double permanent)

private double
insphereexact(double ax, double ay, double az, double bx, double by, double bz, double cx, double cy, double cz, double dx, double dy, double dz, double ex, double ey, double ez)

public double
inspherefast(double ax, double ay, double az, double bx, double by, double bz, double cx, double cy, double cz, double dx, double dy, double dz, double ex, double ey, double ez)

Non-robust counterpart of insphere; the sign may be wrong on near-degenerate inputs.

private int
liftadapt(double[] a, double[] b, double[] cc, double az, double bz, double cz, double x, double y, double z, double[] out)

private int
liftexact(int alen, double[] a, int blen, double[] b, int clen, double[] cc, int dlen, double[] d, double x, double y, double z, double[] out)

private static int
negate(int elen, double[] e)

public double
orient2d(double ax, double ay, double bx, double by, double cx, double cy)

2D orientation test.

private double
orient2dadapt(double ax, double ay, double bx, double by, double cx, double cy, double detsum)

public double
orient2dfast(double ax, double ay, double bx, double by, double cx, double cy)

Non-robust counterpart of orient2d; the sign may be wrong on near-degenerate inputs.

public double
orient3d(double ax, double ay, double az, double bx, double by, double bz, double cx, double cy, double cz, double dx, double dy, double dz)

3D orientation test.

private double
orient3dadapt(double ax, double ay, double az, double bx, double by, double bz, double cx, double cy, double cz, double dx, double dy, double dz, double permanent)

public double
orient3dfast(double ax, double ay, double az, double bx, double by, double bz, double cx, double cy, double cz, double dx, double dy, double dz)

Non-robust counterpart of orient3d; the sign may be wrong on near-degenerate inputs.

private static int
scale(int elen, double[] e, double b, double[] h)

private static double
splitHi(double a)

private static double
squareLo(double a, double x)

private static void
squareSum(double a, double b, double[] D)

private static int
sum(int elen, double[] e, int flen, double[] f, double[] h)

private static int
sum_three(int alen, double[] a, int blen, double[] b, int clen, double[] c, double[] tmp, double[] out)

private int
sum_three_scale(double[] a, double[] b, double[] cc, double az, double bz, double cz, double[] out)

private static void
tailadd(ShewchukExactPredicates.Acc acc, double[] u, double a, double b, double k, double z)

private static int
tailinit(double xtail, double ytail, double ax, double ay, double bx, double by, double[] a, double[] b)

private static double
twoDiffTail(double a, double b, double x)

private static void
twoOneProduct(double a1, double a0, double b, double[] D)

private static double
twoProduct(double a, double b, double[] lo, int loIdx)

private static double
twoProductLo(double a, double b, double x)

private static double
twoProductPresplitLo(double a, double bhi, double blo, double x)

private static void
twoProductSum(double a, double b, double c, double d, double[] D)

private static double
twoSumLo(double a, double b, double x)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait