public class DefaultEuclideanManager extends java.lang.Object implements EuclideanManager
Constructor and Description |
---|
DefaultEuclideanManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
areThreePointsInLine(double ax,
double ay,
double bx,
double by,
double cx,
double cy) |
double |
calculateAngle(double vertexx,
double vertexy,
double px,
double py)
Find the angle in the counterclockwise direction between
the horizontal line and point p relative to the vertex
|
double |
calculateAngle(double vertexx,
double vertexy,
double p1x,
double p1y,
double p2x,
double p2y)
Calculate the angle between points p1 and p2 with vertex at vertex point
|
EuclideanLine2D |
createLine2D(double m,
double b) |
EuclideanLine2D |
createLine2D(double coefA,
double coefB,
double coefC) |
EuclideanLine2D |
createLine2D(double x0,
double y0,
double x1,
double y1) |
EuclideanLine2D |
createLine2D(double m,
java.awt.geom.Point2D p) |
EuclideanLine2D |
createLine2D(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2) |
double |
distance(double x1,
double y1,
double x2,
double y2)
Gets the distance between two points
|
double |
distance(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Gets the distance between two points
|
java.awt.geom.Point2D |
getCenter(double ax,
double ay,
double bx,
double by,
double cx,
double cy)
Gets center point of three points.
|
java.awt.geom.Point2D |
getCenter(java.awt.geom.Point2D a,
java.awt.geom.Point2D b,
java.awt.geom.Point2D c)
Gets center point of three points.
|
double |
getCoefDirection(double centerx,
double centery,
double point1x,
double point1y,
double point2x,
double point2y)
Returns the coefficient that expresses the direction in which the
angle with vertex at center a and from point1 to point2 is beaten
coefDirection >= 0 then the direction is CCW
else the direction is CW
|
double |
getCoefDirection(java.awt.geom.Point2D center,
java.awt.geom.Point2D point1,
java.awt.geom.Point2D point2)
Returns the coefficient that expresses the direction in which the
angle with vertex at center a and from point1 to point2 is beaten
coefDirection >= 0 then the direction is CCW
else the direction is CW
|
java.awt.geom.Point2D |
getMidPoint(double ax,
double ay,
double bx,
double by)
Gets midpoint of two points
|
java.awt.geom.Point2D |
getMidPoint(java.awt.geom.Point2D a,
java.awt.geom.Point2D b)
Gets midpoint of two points
|
java.awt.geom.Point2D |
getPointAtDistance(double x1,
double y1,
double distance,
double angle,
java.lang.String unit) |
double |
getYIntercept(double m,
double x,
double y) |
double |
getYIntercept(double m,
java.awt.geom.Point2D p) |
public EuclideanLine2D createLine2D(double coefA, double coefB, double coefC)
createLine2D
in interface EuclideanManager
public EuclideanLine2D createLine2D(double m, double b)
createLine2D
in interface EuclideanManager
public EuclideanLine2D createLine2D(double x0, double y0, double x1, double y1)
createLine2D
in interface EuclideanManager
public EuclideanLine2D createLine2D(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
createLine2D
in interface EuclideanManager
public EuclideanLine2D createLine2D(double m, java.awt.geom.Point2D p)
createLine2D
in interface EuclideanManager
public double getYIntercept(double m, java.awt.geom.Point2D p)
getYIntercept
in interface EuclideanManager
public double getYIntercept(double m, double x, double y)
getYIntercept
in interface EuclideanManager
public double distance(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
EuclideanManager
distance
in interface EuclideanManager
p1
- Point onep2
- Point twopublic double distance(double x1, double y1, double x2, double y2)
EuclideanManager
distance
in interface EuclideanManager
x1
- x of point oney1
- y of point onex2
- x of point twoy2
- y of point twopublic java.awt.geom.Point2D getCenter(double ax, double ay, double bx, double by, double cx, double cy)
EuclideanManager
getCenter
in interface EuclideanManager
ax
- x of point oneay
- y of point onebx
- x of point twoby
- y of point twocx
- x of point threecy
- y of point threepublic java.awt.geom.Point2D getCenter(java.awt.geom.Point2D a, java.awt.geom.Point2D b, java.awt.geom.Point2D c)
EuclideanManager
getCenter
in interface EuclideanManager
a
- Point oneb
- Point twoc
- Point threepublic java.awt.geom.Point2D getMidPoint(java.awt.geom.Point2D a, java.awt.geom.Point2D b)
EuclideanManager
getMidPoint
in interface EuclideanManager
a
- Point oneb
- Point twopublic java.awt.geom.Point2D getMidPoint(double ax, double ay, double bx, double by)
EuclideanManager
getMidPoint
in interface EuclideanManager
ax
- x of point oneay
- y of point onebx
- x of point twoby
- y of point twopublic double getCoefDirection(double centerx, double centery, double point1x, double point1y, double point2x, double point2y)
EuclideanManager
getCoefDirection
in interface EuclideanManager
public double getCoefDirection(java.awt.geom.Point2D center, java.awt.geom.Point2D point1, java.awt.geom.Point2D point2)
EuclideanManager
getCoefDirection
in interface EuclideanManager
public double calculateAngle(double vertexx, double vertexy, double p1x, double p1y, double p2x, double p2y)
EuclideanManager
calculateAngle
in interface EuclideanManager
public double calculateAngle(double vertexx, double vertexy, double px, double py)
EuclideanManager
calculateAngle
in interface EuclideanManager
public boolean areThreePointsInLine(double ax, double ay, double bx, double by, double cx, double cy)
areThreePointsInLine
in interface EuclideanManager
public java.awt.geom.Point2D getPointAtDistance(double x1, double y1, double distance, double angle, java.lang.String unit)
getPointAtDistance
in interface EuclideanManager