Class Point
java.lang.Object
math.Point
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPoint()
ICreates a Point object at the origin of 3D space.Point
(double x) Initializes a 1D Point objectPoint
(double x, double y) Initializes a 2D Point objectPoint
(double x, double y, double z) Initializes a 2D Point objectCreates a new Point object similar to this one but not referring to the same object -
Method Summary
Modifier and TypeMethodDescriptiondouble
calcDistanceTo
(Point pt) double
findXYGrad
(Point pt) double
findXZGrad
(Point pt) double
findYZGrad
(Point pt) Converts objects of this class to the normal Point object.static SimplePoint
getUtilPoint
(Point point) Converts objects of this class to the normal Point object.double
getX()
double
getY()
double
getZ()
boolean
isCollinearWith
(Point p1, Point p2) boolean
liesBetween
(Point p1, Point p2) static void
static Point
void
setX
(double x) void
setY
(double y) void
setZ
(double z) toString()
-
Field Details
-
x
public double x -
y
public double y -
z
public double z
-
-
Constructor Details
-
Point
public Point()ICreates a Point object at the origin of 3D space. -
Point
public Point(double x) Initializes a 1D Point object- Parameters:
x
- the x coordinate of the Point object
-
Point
public Point(double x, double y) Initializes a 2D Point object- Parameters:
x
- the x coordinate of the Point objecty
- the y coordinate of the Point object
-
Point
public Point(double x, double y, double z) Initializes a 2D Point object- Parameters:
x
- the x coordinate of the Point objecty
- the y coordinate of the Point objectz
- the z coordinate of the Point object
-
Point
Creates a new Point object similar to this one but not referring to the same object- Parameters:
point
- The point to mutate
-
-
Method Details
-
setX
public void setX(double x) - Parameters:
x
- sets x the x coordinate of the Point object
-
getX
public double getX()- Returns:
- x the x coordinate of the Point object
-
setY
public void setY(double y) - Parameters:
y
- x the y coordinate of the Point object
-
getY
public double getY()- Returns:
- x the y coordinate of the Point object
-
setZ
public void setZ(double z) - Parameters:
z
- sets the z coordinate of the Point object
-
getZ
public double getZ()- Returns:
- the z coordinate of the Point object
-
calcDistanceTo
- Parameters:
pt
- the Point object whose distance to this Point object is required- Returns:
- the distance between this Point object and Point pt
-
findXYGrad
- Parameters:
pt
- the point between which an imaginary line runs- Returns:
- the gradient of the projection of the line joining these points on the XY plane
-
findXZGrad
- Parameters:
pt
- the point between which an imaginary line runs- Returns:
- the gradient of the projection of the line joining these points on the XZ plane
-
findYZGrad
- Parameters:
pt
- the point between which an imaginary line runs- Returns:
- the gradient of the projection of the line joining these points on the YZ plane
-
getUtilPoint
Converts objects of this class to the normal Point object.- Returns:
- a java.awt.Point object from this Point object
-
getUtilPoint
Converts objects of this class to the normal Point object.- Parameters:
point
-- Returns:
- a java.awt.Point object from an object of this class.
-
midPoint
-
isCollinearWith
-
liesBetween
-
toString
-
main
-