Class Euclidean2DPosition
-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.Position
,it.unibo.alchemist.model.Position2D
,it.unibo.alchemist.model.geometry.Vector
,it.unibo.alchemist.model.geometry.Vector2D
,java.io.Serializable
public final class Euclidean2DPosition extends AbstractEuclideanPosition<Euclidean2DPosition> implements Position2D<Euclidean2DPosition>, Vector2D<Euclidean2DPosition>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
Euclidean2DPosition.Companion
Constant values and utility methods for Euclidean2DPosition.
-
Field Summary
Fields Modifier and Type Field Description private final Double
x
private final Double
y
private final Euclidean2DPosition
zero
private final DoubleArray
coordinates
private final Integer
dimensions
private final Double
magnitude
private final Double
asAngle
public final static Euclidean2DPosition.Companion
Companion
-
Constructor Summary
Constructors Constructor Description Euclidean2DPosition(Double xp, Double yp)
Euclidean2DPosition(DoubleArray c)
-
Method Summary
Modifier and Type Method Description Double
getX()
Double
getY()
Euclidean2DPosition
getZero()
Euclidean2DPosition
div(Double other)
Euclidean2DPosition
fromCoordinates(DoubleArray coordinates)
Euclidean2DPosition
normal()
Euclidean2DPosition
newFrom(Double x, Double y)
Euclidean2DPosition
times(Double other)
-
Methods inherited from class it.unibo.alchemist.model.positions.AbstractPosition
boundingBox, distanceTo, equals, getCoordinate, getCoordinates, getDimensions, hashCode, minus, minus, plus, plus, toString
-
Methods inherited from class it.unibo.alchemist.model.geometry.Vector
angleBetween, coerceAtLeast, coerceAtMost, coerceIn, dot, getMagnitude, normalized, resized
-
Methods inherited from class it.unibo.alchemist.model.geometry.Vector2D
getAsAngle, isInRectangle, minus, plus, surrounding, surroundingPointAt, surroundingPointAt
-
Methods inherited from class it.unibo.alchemist.model.positions.AbstractEuclideanPosition
get
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
Euclidean2DPosition
Euclidean2DPosition(Double xp, Double yp)
- Parameters:
xp
- The X coordinateyp
- The Y coordinate
-
Euclidean2DPosition
Euclidean2DPosition(DoubleArray c)
- Parameters:
c
- an array of length 2 containing the coordinates
-
-
Method Detail
-
getZero
Euclidean2DPosition getZero()
-
div
Euclidean2DPosition div(Double other)
-
fromCoordinates
Euclidean2DPosition fromCoordinates(DoubleArray coordinates)
-
normal
@Nonnull() Euclidean2DPosition normal()
-
newFrom
@Nonnull() Euclidean2DPosition newFrom(Double x, Double y)
-
times
Euclidean2DPosition times(Double other)
-
-
-
-