Catalano.Core
Class DoublePoint
- java.lang.Object
-
- Catalano.Core.DoublePoint
-
- Direct Known Subclasses:
- OvusculeSnake2DNode
public class DoublePoint extends java.lang.ObjectClass for representing a pair of coordinates of double type.
-
-
Field Summary
Fields Modifier and Type Field and Description doublexY axis coordinate.doubleyY axis coordinate.
-
Constructor Summary
Constructors Constructor and Description DoublePoint()Initializes a new instance of the DoublePoint class.DoublePoint(double x, double y)Initializes a new instance of the DoublePoint class.DoublePoint(DoublePoint point)Initializes a new instance of the DoublePoint class.DoublePoint(float x, float y)Initializes a new instance of the DoublePoint class.DoublePoint(FloatPoint point)Initializes a new instance of the DoublePoint class.DoublePoint(int x, int y)Initializes a new instance of the DoublePoint class.DoublePoint(IntPoint point)Initializes a new instance of the DoublePoint class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidAdd(double value)Adds value of point.voidAdd(DoublePoint point)Adds value of point.DoublePointAdd(DoublePoint point1, DoublePoint point2)Adds values of two points.doubleDistanceTo(DoublePoint anotherPoint)Calculate Euclidean distance between two points.voidDivide(double value)Divides values of two points.voidDivide(DoublePoint point)Divides values of two points.DoublePointDivide(DoublePoint point1, DoublePoint point2)Divides values of two points.booleanequals(java.lang.Object obj)inthashCode()voidMultiply(double value)Multiply value of point.voidMultiply(DoublePoint point)Multiply value of point.DoublePointMultiply(DoublePoint point1, DoublePoint point2)Multiply values of two points.voidsetXY(double x, double y)Sets X and Y axis coordinates.voidSubtract(double value)Subtract value of point.voidSubtract(DoublePoint point)Subtract value of point.DoublePointSubtract(DoublePoint point1, DoublePoint point2)Subtract values of two points.voidSwap()Swap values between the coordinates.FloatPointtoFloatPoint()Convert DoublePoint to FloatPoint.IntPointtoIntPoint()Convert DoublePoint to IntPointjava.lang.StringtoString()
-
-
-
Constructor Detail
-
DoublePoint
public DoublePoint()
Initializes a new instance of the DoublePoint class.
-
DoublePoint
public DoublePoint(DoublePoint point)
Initializes a new instance of the DoublePoint class.- Parameters:
point- DoublePoint.
-
DoublePoint
public DoublePoint(double x, double y)Initializes a new instance of the DoublePoint class.- Parameters:
x- X axis coordinate.y- Y axis coordinate.
-
DoublePoint
public DoublePoint(float x, float y)Initializes a new instance of the DoublePoint class.- Parameters:
x- X axis coordinate.y- Y axis coordinate.
-
DoublePoint
public DoublePoint(int x, int y)Initializes a new instance of the DoublePoint class.- Parameters:
x- X axis coordinate.y- Y axis coordinate.
-
DoublePoint
public DoublePoint(IntPoint point)
Initializes a new instance of the DoublePoint class.- Parameters:
point- DoublePoint.
-
DoublePoint
public DoublePoint(FloatPoint point)
Initializes a new instance of the DoublePoint class.- Parameters:
point- FloatPoint.
-
-
Method Detail
-
setXY
public void setXY(double x, double y)Sets X and Y axis coordinates.- Parameters:
x- X axis coordinate.y- Y axis coordinate.
-
Add
public void Add(DoublePoint point)
Adds value of point.- Parameters:
point- DoublePoint.
-
Add
public DoublePoint Add(DoublePoint point1, DoublePoint point2)
Adds values of two points.- Parameters:
point1- DoublePoint.point2- DoublePoint.- Returns:
- A new DoublePoint with the add operation.
-
Add
public void Add(double value)
Adds value of point.- Parameters:
value- Value.
-
Subtract
public void Subtract(DoublePoint point)
Subtract value of point.- Parameters:
point- DoublePoint.
-
Subtract
public DoublePoint Subtract(DoublePoint point1, DoublePoint point2)
Subtract values of two points.- Parameters:
point1- DoublePoint.point2- DoublePoint.- Returns:
- A new DoublePoint with the subtraction operation.
-
Subtract
public void Subtract(double value)
Subtract value of point.- Parameters:
value- Value.
-
Multiply
public void Multiply(DoublePoint point)
Multiply value of point.- Parameters:
point- DoublePoint.
-
Multiply
public DoublePoint Multiply(DoublePoint point1, DoublePoint point2)
Multiply values of two points.- Parameters:
point1- DoublePoint.point2- DoublePoint.- Returns:
- A new DoublePoint with the multiplication operation.
-
Multiply
public void Multiply(double value)
Multiply value of point.- Parameters:
value- Value.
-
Divide
public void Divide(DoublePoint point)
Divides values of two points.- Parameters:
point- DoublePoint.
-
Divide
public DoublePoint Divide(DoublePoint point1, DoublePoint point2)
Divides values of two points.- Parameters:
point1- DoublePoint.point2- DoublePoint.- Returns:
- A new DoublePoint with the division operation.
-
Divide
public void Divide(double value)
Divides values of two points.- Parameters:
value- Value.
-
DistanceTo
public double DistanceTo(DoublePoint anotherPoint)
Calculate Euclidean distance between two points.- Parameters:
anotherPoint- Point to calculate distance to.- Returns:
- Euclidean distance between this point and anotherPoint points.
-
Swap
public void Swap()
Swap values between the coordinates.
-
toIntPoint
public IntPoint toIntPoint()
Convert DoublePoint to IntPoint- Returns:
- IntPoint.
-
toFloatPoint
public FloatPoint toFloatPoint()
Convert DoublePoint to FloatPoint.- Returns:
- FloatPoint.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG