public class Point extends Geometry implements Cloneable
| Constructor and Description |
|---|
Point(double[] p)
Constructor
|
Point(double x,
double y)
Constructor
|
Point(Point p)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
Point |
clone()
Implements the Cloneable interface
|
double |
getDirectionTo(double x2,
double y2)
Computes the direction (radians) from this point to a specified point
|
double |
getDirectionTo(double centerX,
double centerY,
double radius)
Computes the direction (radians) from the Geometry object to a Circle
|
double |
getDirectionTo(double x1,
double y1,
double x2,
double y2)
Computes the direction (radians) from this point to the closest point on a line segment
|
double |
getDistance(double x2,
double y2)
Computes the distance between this point and another point
|
double |
getDistance(double centerX,
double centerY,
double radius)
Computes the distance from the Geometry object to a Circle
|
double |
getDistance(double x1,
double y1,
double x2,
double y2)
Computes the distance between this point and a line segment
|
double |
getX() |
double |
getY() |
void |
setCoordinates(double[] newPosit)
Sets the Cartesian coordinate (meters) of the point
|
void |
setCoordinates(double newX,
double newY)
Sets the Cartesian coordinate (meters) of the point
|
void |
setCoordinates(Point newPosit)
Sets the Cartesian coordinate (meters) of the point
|
void |
setX(double newX)
Sets the east/west Cartesian coordinate (meters) of the point
|
void |
setY(double newY)
Sets the east/west Cartesian coordinate (meters) of the point
|
String |
toString()
Generates a string representation of the Point object
|
determinant, dotProduct, getClosestPointOnLine, getClosestPointOnSegment, getDirectionTo, getDirectionTo, getDirectionTo, getDirectionTo, getDirectionTo, getDirectionTo, getDirectionTo, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getIntersectPoint, isInSegment, isOnSegment, pointDirection, pointDistancepublic Point(double x,
double y)
public Point(double[] p)
public Point(Point p)
public double getX()
public void setCoordinates(double[] newPosit)
newPosit - the new Cartesian coordinatespublic void setCoordinates(Point newPosit)
newPosit - the new Cartesian coordinatespublic void setCoordinates(double newX,
double newY)
newX - the new north/south Cartesian coordinatenewY - the new east/west Cartesian coordinatepublic void setX(double newX)
newX - the new north/south Cartesian coordinatepublic double getY()
public void setY(double newY)
newY - the new east/west Cartesian coordinatepublic double getDistance(double x2,
double y2)
getDistance in class Geometryx2 - x coordinate of the point being testedy2 - y coordinate of the point being testedpublic double getDirectionTo(double x2,
double y2)
getDirectionTo in class Geometryx2 - x coordinate of the point being testedy2 - y coordinate of the point being testedpublic double getDistance(double centerX,
double centerY,
double radius)
getDistance in class GeometrycenterX - north/south coordinate of the circle being testedcenterY - east/west coordinate of the circle being testedradius - of the circle being testedpublic double getDirectionTo(double centerX,
double centerY,
double radius)
getDirectionTo in class GeometrycenterX - x coordinate of the circle being testedcenterY - y coordinate of the circle being testedradius - of the circle being testedpublic double getDistance(double x1,
double y1,
double x2,
double y2)
getDistance in class Geometryx1 - north/south coordinate of the first segment end pointy1 - east west coordinate of the first segment end pointx2 - north/south coordinate of the second segment end pointy2 - east west coordinate of the second segment end pointpublic double getDirectionTo(double x1,
double y1,
double x2,
double y2)
getDirectionTo in class Geometryx1 - north/south coordinate of the first segment end pointy1 - east west coordinate of the first segment end pointx2 - north/south coordinate of the second segment end pointy2 - east west coordinate of the second segment end point