public class GeometricOperations extends Object
| Constructor and Description |
|---|
GeometricOperations()
Construct an instance based on a nominal point spacing of 1 unit.
|
GeometricOperations(Thresholds thresholds)
Construct an instance based on the specified threshold values.
|
| Modifier and Type | Method and Description |
|---|---|
double |
area(double ax,
double ay,
double bx,
double by,
double cx,
double cy)
Determines the signed area of triangle ABC.
|
double |
area(Vertex a,
Vertex b,
Vertex c)
Determines the signed area of triangle ABC.
|
void |
circumcircle(double vax,
double vay,
double vbx,
double vby,
double vcx,
double vcy,
Circumcircle result)
Computes the circumcircle for the coordinates of three vertices.
|
boolean |
circumcircle(Vertex a,
Vertex b,
Vertex c,
Circumcircle result)
Computes the circumcircle for the coordinates of three vertices.
|
void |
clearDiagnostics()
Clear the diagnostic operation counts maintained by this class.
|
double |
direction(double ax,
double ay,
double bx,
double by,
double cx,
double cy)
Uses extended arithmetic to find the direction of
a point with coordinates (cx, cy) compared to a
directed edge from vertex A to B.
|
long |
getCircumcircleCount()
Get a diagnostic count of the number of circumcircle calculations
|
long |
getExtendedCircumcircleCount()
Get a diagnostic count of the number of circumcircle calculations
that required extended precision arithmetic
|
long |
getExtendedConflictCount()
Get a diagnostic count of the number of incidents where an extended
precision calculation was in conflict with the ordinary precision
calculation.
|
long |
getExtendedPrecisionInCircleCount()
Get a diagnostic count of the number of incidents where an extended
precision calculation was required for an in-circle calculation
due to the small-magnitude value of the computed value.
|
long |
getHalfPlaneCount()
Get a diagnostic count of the number of half-plane calculations
|
long |
getInCircleCount()
Get a diagnostic count of the number of times an in-circle calculation
was performed.
|
Thresholds |
getThresholds()
Gets the threshold values associated with this instance.
|
double |
halfPlane(double ax,
double ay,
double bx,
double by,
double cx,
double cy)
Uses extended arithmetic to find the side on which a point lies with
respect to a directed edge.
|
double |
inCircle(double ax,
double ay,
double bx,
double by,
double cx,
double cy,
double dx,
double dy)
Determines if vertex d lies within the circumcircle of triangle a,b,c,
using extended-precision arithmetic when required by small
magnitude results.
|
double |
inCircle(Vertex a,
Vertex b,
Vertex c,
Vertex d)
Determines if vertex d lies within the circumcircle of triangle a,b,c,
using extended-precision arithmetic when required by small
magnitude results.
|
double |
inCircleQuadPrecision(double ax,
double ay,
double bx,
double by,
double cx,
double cy,
double dx,
double dy)
Uses quad-precision methods to determines if vertex d lies
within the circumcircle of triangle a,b,c.
|
double |
orientation(double ax,
double ay,
double bx,
double by,
double cx,
double cy)
Use extended arithmetic to compute the signed orientation
of the triangle defined by three points
|
public GeometricOperations()
public GeometricOperations(Thresholds thresholds)
thresholds - a valid instancepublic double inCircle(Vertex a, Vertex b, Vertex c, Vertex d)
a - a valid vertexb - a valid vertexc - a valid vertexd - a valid vertexpublic double inCircle(double ax,
double ay,
double bx,
double by,
double cx,
double cy,
double dx,
double dy)
ax - the x coordinate of vertex aay - the y coordinate of vertex abx - the x coordinate of vertex bby - the y coordinate of vertex bcx - the x coordinate of vertex ccy - the y coordinate of vertex cdx - the x coordinate of vertex ddy - the y coordinate of vertex dpublic double inCircleQuadPrecision(double ax,
double ay,
double bx,
double by,
double cx,
double cy,
double dx,
double dy)
ax - the x coordinate of vertex aay - the y coordinate of vertex abx - the x coordinate of vertex bby - the y coordinate of vertex bcx - the x coordinate of vertex ccy - the y coordinate of vertex cdx - the x coordinate of vertex ddy - the y coordinate of vertex dpublic double halfPlane(double ax,
double ay,
double bx,
double by,
double cx,
double cy)
ax - the x coordinate of the first vertex in the segmentay - the y coordinate of the first vertex in the segmentbx - the x coordinate of the second vertex in the segmentby - the y coordinate of the second vertex in the segmentcx - the x coordinate of the point of interestcy - the y coordinate of the point of interestpublic double direction(double ax,
double ay,
double bx,
double by,
double cx,
double cy)
ax - the x coordinate of the initial point on the edgeay - the y coordinate of the initial point on the edgebx - the x coordinate of the second point on the edgeby - the y coordinate of the second point on the edgecx - the coordinate of interestcy - the coordinate of interestpublic double orientation(double ax,
double ay,
double bx,
double by,
double cx,
double cy)
ax - x coordinate of the first pointay - y coordinate of the first pointbx - x coordinate of the second pointby - y coordinate of the second pointcx - x coordinate of the third pointcy - y coordinate of the third pointpublic long getInCircleCount()
public long getExtendedPrecisionInCircleCount()
public long getExtendedConflictCount()
public long getHalfPlaneCount()
public long getCircumcircleCount()
public long getExtendedCircumcircleCount()
public double area(Vertex a, Vertex b, Vertex c)
a - the initial vertexb - the second vertexc - the third vertexpublic double area(double ax,
double ay,
double bx,
double by,
double cx,
double cy)
ax - the x coordinate of the first vertex in the triangleay - the y coordinate of the first vertex in the trianglebx - the x coordinate of the second vertex in the triangleby - the y coordinate of the second vertex in the trianglecx - the x coordinate of the third vertex in the trianglecy - the y coordinate of the point vertex in the trianglepublic void clearDiagnostics()
public boolean circumcircle(Vertex a, Vertex b, Vertex c, Circumcircle result)
a - Vertex Ab - Vertex Bc - Vertex Cresult - a valid instance to store the result.public void circumcircle(double vax,
double vay,
double vbx,
double vby,
double vcx,
double vcy,
Circumcircle result)
vax - The x coordinate of vertex Avay - The y coordinate of vertex Avbx - The x coordinate of vertex Bvby - The y coordinate of vertex Bvcx - The x coordinate of vertex Cvcy - The y coordinate of vertex Cresult - a valid instance to store the result.public Thresholds getThresholds()
Copyright © 2021. All rights reserved.