Package com.uppaal.model.io2
Class FloatPoint
java.lang.Object
java.awt.geom.Point2D
java.awt.geom.Point2D.Float
com.uppaal.model.io2.FloatPoint
- All Implemented Interfaces:
Serializable,Cloneable
public class FloatPoint extends Point2D.Float
- See Also:
- Serialized Form
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Constructor Description FloatPoint(float x, float y)Creates a point from given coordinatesFloatPoint(Point2D point) -
Method Summary
Modifier and Type Method Description FloatPointadd(int addX, int addY)Returns a point with this point's coordinates added with the given coordinates.FloatPointadd(FloatPoint add)Returns a point with this point's coordinates added with the given point.IntPointgetIntPoint()Returns an integer rounded version of this pointfloatlength()Returns the length of this point's vectorFloatPointmultiply(float mult)Returns a point which is a multiplication of this pointFloatPointrotate(double radAngle)Returns this point's vector rotated according to the radian angleFloatPointsubtract(float subX, float subY)Returns a point with this point's coordinates subtracted by the given coordinates.FloatPointsubtract(FloatPoint sub)Returns a point with this point's coordinates subtracted by the given point.StringtoString()Returns a string representation of this objectFloatPointunitVector()Returns the unit vector for this point's vectorMethods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation
-
Constructor Details
-
FloatPoint
public FloatPoint(float x, float y)Creates a point from given coordinates- Parameters:
x- coordinatey- coordinate
-
FloatPoint
-
-
Method Details
-
subtract
Returns a point with this point's coordinates subtracted by the given coordinates.- Parameters:
subX- the length to be subtracted from x coordinatesubY- the length to be subtracted from y coordinate- Returns:
- new point.
-
subtract
Returns a point with this point's coordinates subtracted by the given point.- Parameters:
sub- a vector to be subtracted.- Returns:
- a new point.
-
add
Returns a point with this point's coordinates added with the given coordinates.- Parameters:
addX- length to be added to x coordinateaddY- length to be added to y coordinate- Returns:
- new point.
-
add
Returns a point with this point's coordinates added with the given point.- Parameters:
add- a vector to be added.- Returns:
- new point.
-
multiply
Returns a point which is a multiplication of this point- Parameters:
mult- the scale to multiply.- Returns:
- new point.
-
getIntPoint
Returns an integer rounded version of this point- Returns:
- integer representation of the point.
-
length
public float length()Returns the length of this point's vector- Returns:
- the distance to origin.
-
unitVector
Returns the unit vector for this point's vector- Returns:
- normalized direction of the vector.
-
rotate
Returns this point's vector rotated according to the radian angle- Parameters:
radAngle- angle in radians- Returns:
- rotated vector.
-
toString
Returns a string representation of this object- Overrides:
toStringin classPoint2D.Float- Returns:
- string representing this point.
-