Package com.itextpdf.kernel.geom
Class Point
java.lang.Object
com.itextpdf.kernel.geom.Point
- All Implemented Interfaces:
-
Cloneable
Class that represent point object with x and y coordinates.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()doubledistance(double px, double py) The distance between this point and the second point which is defined by passed x and y coordinates.doubleThe distance between this point and the second point.booleanGets location of point by creating a new copy.doublegetX()Gets x coordinate of the point.doublegetY()Gets y coordinate of the point.inthashCode()voidmove(double dx, double dy) Moves the point by the specified offset.voidsetLocation(double x, double y) Sets x and y double coordinates of the point.toString()
-
Constructor Details
-
Point
public Point()Instantiates a newPointinstance with 0 x and y. -
Point
public Point(double x, double y) Instantiates a newPointinstance based on passed x and y.- Parameters:
-
x- the x coordinates of the point -
y- the y coordinates of the point
-
Point
- Parameters:
-
other- otherPointinstance from which coordinates will be copied
-
-
Method Details
-
getX
public double getX()Gets x coordinate of the point.- Returns:
- the x coordinate
-
getY
public double getY()Gets y coordinate of the point.- Returns:
- the y coordinate
-
getLocation
Gets location of point by creating a new copy.- Returns:
- the copy of this point
-
setLocation
public void setLocation(double x, double y) Sets x and y double coordinates of the point.- Parameters:
-
x- the x coordinate -
y- the y coordinate
-
move
public void move(double dx, double dy) Moves the point by the specified offset.- Parameters:
-
dx- the x-axis offset -
dy- the y-axis offset
-
distance
public double distance(double px, double py) The distance between this point and the second point which is defined by passed x and y coordinates.- Parameters:
-
px- the x coordinate of the second point -
py- the y coordinate of the second point - Returns:
- the distance between points
-
distance
The distance between this point and the second point.- Parameters:
-
p- the second point to calculate distance - Returns:
- the distance between points
-
equals
-
toString
-
hashCode
public int hashCode() -
clone
-