Package org.arakhne.afc.math.geometry.d2
Class ImmutableVector2D
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.ImmutableVector2D
-
- All Implemented Interfaces:
Serializable,Cloneable,Tuple2D<ImmutableVector2D>,UnmodifiableTuple2D<ImmutableVector2D>,UnmodifiableVector2D<ImmutableVector2D,ImmutablePoint2D>,Vector2D<ImmutableVector2D,ImmutablePoint2D>,JsonableObject
public final class ImmutableVector2D extends Object implements UnmodifiableVector2D<ImmutableVector2D,ImmutablePoint2D>
Immutable vector 2D.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.Vector2D
Vector2D.PowerResult<T extends Vector2D<? super T,?>>
-
-
Constructor Summary
Constructors Constructor Description ImmutableVector2D(double x, double y)Constructor.ImmutableVector2D(int x, int y)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableVector2Dclone()Clone this point.booleanequals(Object object)Returns true if the Object t1 is of type Tuple2D and all of the data members of t1 are equal to the corresponding data members in this Tuple2D.ImmutableGeomFactorygetGeomFactory()Replies the geometry factory associated to this point.doublegetX()Get the x coordinate.doublegetY()Get the y coordinate.inthashCode()Returns a hash code value based on the data values in this object.intix()Get the x coordinate.intiy()Get the y coordinate.voidtoJson(JsonBuffer buffer)Replies the Json representation of this node.ImmutableVector2DtoOrthogonalVector()Replies the orthogonal vector to this vector.StringtoString()ImmutableVector2DtoUnitVector()Replies the unit vector of this vector.-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Tuple2D
epsilonEquals, equals, get, get, get
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.UnmodifiableTuple2D
absolute, absolute, add, add, addX, addX, addY, addY, clamp, clamp, clamp, clamp, clampMax, clampMax, clampMax, clampMax, clampMin, clampMin, clampMin, clampMin, interpolate, interpolate, negate, negate, scale, scale, scale, scale, set, set, set, set, set, setX, setX, setY, setY, sub, sub, subX, subX, subY, subY
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.UnmodifiableVector2D
add, add, makeOrthogonal, normalize, normalize, operator_add, operator_remove, scaleAdd, scaleAdd, scaleAdd, scaleAdd, setLength, sub, sub, sub, toUnmodifiable, turn, turn, turnLeft, turnLeft, turnRight, turnRight
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Vector2D
$div, $minus, $minus, $minus, $minus, $plus, $plus, $plus, $times, $times, $up, $up, angle, dot, getLength, getLengthSquared, getOrientationAngle, isOrthogonal, isUnitVector, operator_divide, operator_doubleDotLessThan, operator_elvis, operator_equals, operator_greaterThanDoubleDot, operator_minus, operator_minus, operator_minus, operator_minus, operator_multiply, operator_multiply, operator_notEquals, operator_plus, operator_plus, operator_plus, operator_power, operator_power, operator_upTo, perp, power, signedAngle, toColinearVector, turnLeft
-
-
-
-
Method Detail
-
equals
@Pure public boolean equals(Object object)
Description copied from interface:Tuple2DReturns true if the Object t1 is of type Tuple2D and all of the data members of t1 are equal to the corresponding data members in this Tuple2D.- Specified by:
equalsin interfaceTuple2D<ImmutableVector2D>- Overrides:
equalsin classObject- Parameters:
object- the object with which the comparison is made- Returns:
- true or false
-
getGeomFactory
public ImmutableGeomFactory getGeomFactory()
Description copied from interface:Vector2DReplies the geometry factory associated to this point.- Specified by:
getGeomFactoryin interfaceVector2D<ImmutableVector2D,ImmutablePoint2D>- Returns:
- the factory.
-
hashCode
@Pure public int hashCode()
Description copied from interface:Tuple2DReturns a hash code value based on the data values in this object. Two differentTuple2Dobjects with identical data values (i.e.,Tuple2D.equals(Object)returns true) will return the same hash code value. Two objects with different data members may return the same hash value, although this is not likely.- Specified by:
hashCodein interfaceTuple2D<ImmutableVector2D>- Overrides:
hashCodein classObject- Returns:
- the integer hash code value
-
toJson
public void toJson(JsonBuffer buffer)
Description copied from interface:JsonableObjectReplies the Json representation of this node.- Specified by:
toJsonin interfaceJsonableObject- Parameters:
buffer- the Json buffer.
-
clone
public ImmutableVector2D clone()
Description copied from interface:Tuple2DClone this point.- Specified by:
clonein interfaceTuple2D<ImmutableVector2D>- Overrides:
clonein classObject- Returns:
- the clone.
-
getX
@Pure public double getX()
Description copied from interface:Tuple2DGet the x coordinate.- Specified by:
getXin interfaceTuple2D<ImmutableVector2D>- Returns:
- the x coordinate.
-
ix
@Pure public int ix()
Description copied from interface:Tuple2DGet the x coordinate.- Specified by:
ixin interfaceTuple2D<ImmutableVector2D>- Returns:
- the x coordinate.
-
getY
@Pure public double getY()
Description copied from interface:Tuple2DGet the y coordinate.- Specified by:
getYin interfaceTuple2D<ImmutableVector2D>- Returns:
- the y coordinate.
-
iy
@Pure public int iy()
Description copied from interface:Tuple2DGet the y coordinate.- Specified by:
iyin interfaceTuple2D<ImmutableVector2D>- Returns:
- the y coordinate.
-
toUnitVector
@Pure public ImmutableVector2D toUnitVector()
Description copied from interface:Vector2DReplies the unit vector of this vector.- Specified by:
toUnitVectorin interfaceVector2D<ImmutableVector2D,ImmutablePoint2D>- Returns:
- the unit vector of this vector.
-
toOrthogonalVector
@Pure public ImmutableVector2D toOrthogonalVector()
Description copied from interface:Vector2DReplies the orthogonal vector to this vector.The orthogonal vector is always the one obtain after a clockwise rotation of this vector.
The orthogonal vector does not depends on the current coordinate system.
- Specified by:
toOrthogonalVectorin interfaceVector2D<ImmutableVector2D,ImmutablePoint2D>- Returns:
- the orthogonal vector.
-
-