- java.lang.Object
-
- org.arakhne.afc.math.geometry.d3.i.Tuple3i<Vector3i>
-
- org.arakhne.afc.math.geometry.d3.i.Vector3i
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Tuple3D<Vector3i>
,Vector3D<Vector3i,Point3i>
,JsonableObject
public class Vector3i extends Tuple3i<Vector3i> implements Vector3D<Vector3i,Point3i>
2D Vector with 2 integer numbers.- 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.d3.Vector3D
Vector3D.PowerResult<T extends Vector3D<? super T,?>>
-
-
Constructor Summary
Constructors Constructor Description Vector3i()
Construct a zero vector.Vector3i(double[] tuple)
Constructor by copy.Vector3i(double x, double y, double z)
Constructor a vector with the given coordinates.Vector3i(float x, float y, float z)
Constructor a vector with the given coordinates.Vector3i(int[] tuple)
Constructor by copy.Vector3i(int x, int y, int z)
Constructor a vector with the given coordinates.Vector3i(long x, long y, long z)
Constructor a vector with the given coordinates.Vector3i(Tuple3D<?> tuple)
Constructor by copy.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Vector3D<?,?> vector)
Sets the value of this tuple to the sum of itself and t1.void
add(Vector3D<?,?> vector1, Vector3D<?,?> vector2)
Sets the value of this tuple to the sum of tuples t1 and t2.static Vector3i
convert(Tuple3D<?> tuple)
Convert the given tuple to a real Vector3i.double
dot(Vector3D<?,?> vector)
Computes the dot product of the this vector and vector v1.GeomFactory3i
getGeomFactory()
Replies the geometry factory associated to this point.double
getLength()
Returns the length of this vector.double
getLengthSquared()
Returns the squared length of this vector.double
perp(Vector3D<?,?> vector)
Compute the determinant of two vectors.void
scaleAdd(double scale, Vector3D<?,?> vector)
Sets the value of this tuple to the scalar multiplication of itself and then adds tuple t1 (this = s*this + t1).void
scaleAdd(double scale, Vector3D<?,?> vector1, Vector3D<?,?> vector2)
Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).void
scaleAdd(int scale, Vector3D<?,?> vector)
Sets the value of this tuple to the scalar multiplication of itself and then adds tuple t1 (this = s*this + t1).void
scaleAdd(int scale, Vector3D<?,?> vector1, Vector3D<?,?> vector2)
Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).void
setLength(double newLength)
Change the length of the vector.void
sub(Point3D<?,?> point1, Point3D<?,?> point2)
Sets the value of this tuple to the difference of tuples t1 and t2 (this = t1 - t2).void
sub(Vector3D<?,?> vector)
Sets the value of this tuple to the difference of itself and t1 (this = this - t1).void
sub(Vector3D<?,?> vector1, Vector3D<?,?> vector2)
Sets the value of this tuple to the difference of tuples t1 and t2 (this = t1 - t2).UnmodifiableVector3D<Vector3i,Point3i>
toUnmodifiable()
Replies an unmodifiable copy of this vector.-
Methods inherited from class org.arakhne.afc.math.geometry.d3.i.Tuple3i
absolute, absolute, add, add, addX, addX, addY, addY, addZ, addZ, clone, equals, getX, getY, getZ, hashCode, ix, iy, iz, negate, negate, scale, scale, scale, scale, set, set, set, set, set, setX, setX, setY, setY, setZ, setZ, sub, sub, subX, subX, subY, subY, subZ, subZ, toJson, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.Tuple3D
absolute, absolute, add, add, addX, addX, addY, addY, addZ, addZ, clamp, clamp, clamp, clamp, clampMax, clampMax, clampMax, clampMax, clampMin, clampMin, clampMin, clampMin, clone, epsilonEquals, equals, equals, get, get, get, getX, getY, getZ, hashCode, interpolate, interpolate, ix, iy, iz, negate, negate, scale, scale, scale, scale, set, set, set, set, set, setX, setX, setY, setY, setZ, setZ, sub, sub, subX, subX, subY, subY, subZ, subZ
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.Vector3D
angle, cross, cross, crossLeftHand, crossLeftHand, crossRightHand, crossRightHand, isColinear, isUnitVector, normalize, normalize, operator_add, operator_divide, operator_doubleDotLessThan, operator_elvis, operator_equals, operator_greaterThanDoubleDot, operator_minus, operator_minus, operator_multiply, operator_multiply, operator_notEquals, operator_plus, operator_plus, operator_power, operator_power, operator_remove, operator_upTo, power, signedAngle, toColinearVector, toUnitVector, turnVector
-
-
-
-
Constructor Detail
-
Vector3i
public Vector3i()
Construct a zero vector.
-
Vector3i
public Vector3i(Tuple3D<?> tuple)
Constructor by copy.- Parameters:
tuple
- is the tuple to copy.
-
Vector3i
public Vector3i(int[] tuple)
Constructor by copy.- Parameters:
tuple
- is the tuple to copy.
-
Vector3i
public Vector3i(double[] tuple)
Constructor by copy.- Parameters:
tuple
- is the tuple to copy.
-
Vector3i
public Vector3i(int x, int y, int z)
Constructor a vector with the given coordinates.- Parameters:
x
- x coordinate.y
- y coordinate.z
- z coordinate.
-
Vector3i
public Vector3i(float x, float y, float z)
Constructor a vector with the given coordinates.- Parameters:
x
- x coordinate.y
- y coordinate.z
- z coordinate.
-
Vector3i
public Vector3i(double x, double y, double z)
Constructor a vector with the given coordinates.- Parameters:
x
- x coordinate.y
- y coordinate.z
- z coordinate.
-
Vector3i
public Vector3i(long x, long y, long z)
Constructor a vector with the given coordinates.- Parameters:
x
- x coordinate.y
- y coordinate.z
- z coordinate.
-
-
Method Detail
-
convert
public static Vector3i convert(Tuple3D<?> tuple)
Convert the given tuple to a real Vector3i.If the given tuple is already a Vector3i, it is replied.
- Parameters:
tuple
- the tuple.- Returns:
- the Vector3i.
- Since:
- 14.0
-
dot
@Pure public double dot(Vector3D<?,?> vector)
Description copied from interface:Vector3D
Computes the dot product of the this vector and vector v1.
-
perp
@Pure public double perp(Vector3D<?,?> vector)
Description copied from interface:Vector3D
Compute the determinant of two vectors.
wheredet(this, V) = |this|.|V|.sin(a)
this
andV
are two vectors anda
is the angle betweenthis
andV
.
-
getLength
@Pure public double getLength()
Description copied from interface:Vector3D
Returns the length of this vector.
-
getLengthSquared
@Pure public double getLengthSquared()
Description copied from interface:Vector3D
Returns the squared length of this vector.- Specified by:
getLengthSquared
in interfaceVector3D<Vector3i,Point3i>
- Returns:
- the squared length of this vector
-
add
public void add(Vector3D<?,?> vector1, Vector3D<?,?> vector2)
Description copied from interface:Vector3D
Sets the value of this tuple to the sum of tuples t1 and t2.
-
add
public void add(Vector3D<?,?> vector)
Description copied from interface:Vector3D
Sets the value of this tuple to the sum of itself and t1.
-
scaleAdd
public void scaleAdd(int scale, Vector3D<?,?> vector1, Vector3D<?,?> vector2)
Description copied from interface:Vector3D
Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).
-
scaleAdd
public void scaleAdd(double scale, Vector3D<?,?> vector1, Vector3D<?,?> vector2)
Description copied from interface:Vector3D
Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).
-
scaleAdd
public void scaleAdd(int scale, Vector3D<?,?> vector)
Description copied from interface:Vector3D
Sets the value of this tuple to the scalar multiplication of itself and then adds tuple t1 (this = s*this + t1).
-
scaleAdd
public void scaleAdd(double scale, Vector3D<?,?> vector)
Description copied from interface:Vector3D
Sets the value of this tuple to the scalar multiplication of itself and then adds tuple t1 (this = s*this + t1).
-
sub
public void sub(Vector3D<?,?> vector1, Vector3D<?,?> vector2)
Description copied from interface:Vector3D
Sets the value of this tuple to the difference of tuples t1 and t2 (this = t1 - t2).
-
sub
public void sub(Point3D<?,?> point1, Point3D<?,?> point2)
Description copied from interface:Vector3D
Sets the value of this tuple to the difference of tuples t1 and t2 (this = t1 - t2).
-
sub
public void sub(Vector3D<?,?> vector)
Description copied from interface:Vector3D
Sets the value of this tuple to the difference of itself and t1 (this = this - t1).
-
setLength
public void setLength(double newLength)
Description copied from interface:Vector3D
Change the length of the vector. The direction of the vector is unchanged.
-
getGeomFactory
public GeomFactory3i getGeomFactory()
Description copied from interface:Vector3D
Replies the geometry factory associated to this point.- Specified by:
getGeomFactory
in interfaceVector3D<Vector3i,Point3i>
- Returns:
- the factory.
-
toUnmodifiable
@Pure public UnmodifiableVector3D<Vector3i,Point3i> toUnmodifiable()
Description copied from interface:Vector3D
Replies an unmodifiable copy of this vector.- Specified by:
toUnmodifiable
in interfaceVector3D<Vector3i,Point3i>
- Returns:
- an unmodifiable copy.
-
-