-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classVector2D.Companion
-
Method Summary
Modifier and Type Method Description Doubledot(P other)Dot product between bidimensional vectors. BooleanisInRectangle(Vector2D<?> origin, Double width, Double height)Checks whether the given point is inside a rectangular region described by an origin point and width and height values (only positive). abstract PnewFrom(Double x, Double y)Creates a new Vector2D with the same type of the current one with different x and y. Pminus(Pair<Double, Double> other)Allows subtraction with a Pair. Pnormalized()Normalizes the vector. Pplus(Pair<Double, Double> other)Allows summaction with a Pair. PsurroundingPointAt(Double angle, Double distance)Computes a point which is at a certain distance and angle (in radians) from this one. PsurroundingPointAt(P versor, Double distance)Computes a point which is at a certain distance and angle (expressed as a versor centered in this node) from this one. List<P>surrounding(Double radius, Integer count)Creates a list of count points equally spaced in the circle of given radius with center in this vector. DoublegetX()DoublegetY()DoublegetAsAngle()abstract IntegergetDimensions()The dimensions of the space this vector belongs to. abstract DoubleArraygetCoordinates()Coordinates for a Cartesian space. DoublegetMagnitude()-
Methods inherited from class it.unibo.alchemist.model.interfaces.geometry.Vector2D
angleBetween, coerceAtLeast, coerceAtMost, coerceIn, distanceTo, div, get, minus, normal, plus, resized, times -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
isInRectangle
Boolean isInRectangle(Vector2D<?> origin, Double width, Double height)
-
normalized
P normalized()
Normalizes the vector.
-
surroundingPointAt
P surroundingPointAt(Double angle, Double distance)
-
surroundingPointAt
P surroundingPointAt(P versor, Double distance)
-
surrounding
List<P> surrounding(Double radius, Integer count)
Creates a list of count points equally spaced in the circle of given radius with center in this vector.
- Parameters:
radius-the distance each generated position must have from this.count-the number of positions to generate.
-
getAsAngle
Double getAsAngle()
-
getDimensions
abstract Integer getDimensions()
The dimensions of the space this vector belongs to.
-
getCoordinates
abstract DoubleArray getCoordinates()
Coordinates for a Cartesian space. Implementors must guarantee that internal state is not exposed.
-
getMagnitude
Double getMagnitude()
-
-
-
-