- 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 voidadd(Vector3D<?,?> vector)Sets the value of this tuple to the sum of itself and t1.voidadd(Vector3D<?,?> vector1, Vector3D<?,?> vector2)Sets the value of this tuple to the sum of tuples t1 and t2.static Vector3iconvert(Tuple3D<?> tuple)Convert the given tuple to a real Vector3i.doubledot(Vector3D<?,?> vector)Computes the dot product of the this vector and vector v1.GeomFactory3igetGeomFactory()Replies the geometry factory associated to this point.doublegetLength()Returns the length of this vector.doublegetLengthSquared()Returns the squared length of this vector.doubleperp(Vector3D<?,?> vector)Compute the determinant of two vectors.voidscaleAdd(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).voidscaleAdd(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).voidscaleAdd(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).voidscaleAdd(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).voidsetLength(double newLength)Change the length of the vector.voidsub(Point3D<?,?> point1, Point3D<?,?> point2)Sets the value of this tuple to the difference of tuples t1 and t2 (this = t1 - t2).voidsub(Vector3D<?,?> vector)Sets the value of this tuple to the difference of itself and t1 (this = this - t1).voidsub(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:Vector3DComputes the dot product of the this vector and vector v1.
-
perp
@Pure public double perp(Vector3D<?,?> vector)
Description copied from interface:Vector3DCompute the determinant of two vectors.
wheredet(this, V) = |this|.|V|.sin(a)thisandVare two vectors andais the angle betweenthisandV.
-
getLength
@Pure public double getLength()
Description copied from interface:Vector3DReturns the length of this vector.
-
getLengthSquared
@Pure public double getLengthSquared()
Description copied from interface:Vector3DReturns the squared length of this vector.- Specified by:
getLengthSquaredin interfaceVector3D<Vector3i,Point3i>- Returns:
- the squared length of this vector
-
add
public void add(Vector3D<?,?> vector1, Vector3D<?,?> vector2)
Description copied from interface:Vector3DSets the value of this tuple to the sum of tuples t1 and t2.
-
add
public void add(Vector3D<?,?> vector)
Description copied from interface:Vector3DSets 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:Vector3DSets 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:Vector3DSets 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:Vector3DSets 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:Vector3DSets 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:Vector3DSets 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:Vector3DSets 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:Vector3DSets 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:Vector3DChange the length of the vector. The direction of the vector is unchanged.
-
getGeomFactory
public GeomFactory3i getGeomFactory()
Description copied from interface:Vector3DReplies the geometry factory associated to this point.- Specified by:
getGeomFactoryin interfaceVector3D<Vector3i,Point3i>- Returns:
- the factory.
-
toUnmodifiable
@Pure public UnmodifiableVector3D<Vector3i,Point3i> toUnmodifiable()
Description copied from interface:Vector3DReplies an unmodifiable copy of this vector.- Specified by:
toUnmodifiablein interfaceVector3D<Vector3i,Point3i>- Returns:
- an unmodifiable copy.
-
-