- java.lang.Object
-
- org.arakhne.afc.math.geometry.d3.i.Tuple3i<Point3i>
-
- org.arakhne.afc.math.geometry.d3.i.Point3i
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Point3D<Point3i,Vector3i>
,Tuple3D<Point3i>
,JsonableObject
- Direct Known Subclasses:
OrientedPoint3i
public class Point3i extends Tuple3i<Point3i> implements Point3D<Point3i,Vector3i>
2D Point with 2 integer numbers.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND, Thomas PIOTROWSKI
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Constructor Summary
Constructors Constructor Description Point3i()
Construct a zero point.Point3i(double[] tuple)
Constructor by copy.Point3i(double x, double y, double z)
Construct a point with the given coordinates.Point3i(float x, float y, float z)
Construct a point with the given coordinates.Point3i(int[] tuple)
Constructor by copy.Point3i(int x, int y, int z)
Construct a point with the given coordinates.Point3i(long x, long y, long z)
Construct a point with the given coordinates.Point3i(Tuple3D<?> tuple)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Point3D<?,?> point, Vector3D<?,?> vector)
Sets the value of this tuple to the sum of tuples t1 and t2.void
add(Vector3D<?,?> vector)
Sets the value of this tuple to the sum of itself and t1.void
add(Vector3D<?,?> vector, Point3D<?,?> point)
Sets the value of this tuple to the sum of tuples t1 and t2.static Point3i
convert(Tuple3D<?> tuple)
Convert the given tuple to a real Point2i.double
getDistance(Point3D<?,?> point)
Computes the distance between this point and point p1.double
getDistanceL1(Point3D<?,?> point)
Computes the L-1 (Manhattan) distance between this point and point p1.double
getDistanceLinf(Point3D<?,?> point)
Computes the L-infinite distance between this point and point p1.double
getDistanceSquared(Point3D<?,?> point)
Computes the square of the distance between this point and point p1.GeomFactory3i
getGeomFactory()
Replies the geometry factory associated to this point.int
getIdistanceL1(Point3D<?,?> point)
Computes the L-1 (Manhattan) distance between this point and point p1.int
getIdistanceLinf(Point3D<?,?> point)
Computes the L-infinite distance between this point and point p1.void
scaleAdd(double scale, Point3D<?,?> point, Vector3D<?,?> vector)
Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).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<?,?> vector, Point3D<?,?> point)
Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).void
scaleAdd(int scale, Point3D<?,?> point, Vector3D<?,?> vector)
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<?,?> vector, Point3D<?,?> point)
Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).void
sub(Point3D<?,?> point, Vector3D<?,?> vector)
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).UnmodifiablePoint3D<Point3i,Vector3i>
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.Point3D
operator_add, operator_and, operator_elvis, operator_equals, operator_minus, operator_minus, operator_notEquals, operator_plus, operator_remove, operator_upTo, operator_upTo
-
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
-
-
-
-
Constructor Detail
-
Point3i
public Point3i()
Construct a zero point.
-
Point3i
public Point3i(Tuple3D<?> tuple)
Constructor.- Parameters:
tuple
- is the tuple to copy.
-
Point3i
public Point3i(int[] tuple)
Constructor by copy.- Parameters:
tuple
- is the tuple to copy.
-
Point3i
public Point3i(double[] tuple)
Constructor by copy.- Parameters:
tuple
- is the tuple to copy.
-
Point3i
public Point3i(int x, int y, int z)
Construct a point with the given coordinates.- Parameters:
x
- x coordinate.y
- y coordinate.z
- z coordinate.
-
Point3i
public Point3i(float x, float y, float z)
Construct a point with the given coordinates.- Parameters:
x
- x coordinate.y
- y coordinate.z
- z coordinate.
-
Point3i
public Point3i(double x, double y, double z)
Construct a point with the given coordinates.- Parameters:
x
- x coordinate.y
- y coordinate.z
- z coordinate.
-
Point3i
public Point3i(long x, long y, long z)
Construct a point with the given coordinates.- Parameters:
x
- x coordinate.y
- y coordinate.z
- z coordinate.
-
-
Method Detail
-
convert
public static Point3i convert(Tuple3D<?> tuple)
Convert the given tuple to a real Point2i.If the given tuple is already a Point2i, it is replied.
- Parameters:
tuple
- the tuple.- Returns:
- the Point2i.
- Since:
- 14.0
-
getDistanceSquared
@Pure public double getDistanceSquared(Point3D<?,?> point)
Description copied from interface:Point3D
Computes the square of the distance between this point and point p1.- Specified by:
getDistanceSquared
in interfacePoint3D<Point3i,Vector3i>
- Parameters:
point
- the other point- Returns:
- the distance.
-
getDistance
@Pure public double getDistance(Point3D<?,?> point)
Description copied from interface:Point3D
Computes the distance between this point and point p1.- Specified by:
getDistance
in interfacePoint3D<Point3i,Vector3i>
- Parameters:
point
- the other point- Returns:
- the distance.
-
getDistanceL1
@Pure public double getDistanceL1(Point3D<?,?> point)
Description copied from interface:Point3D
Computes the L-1 (Manhattan) distance between this point and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).- Specified by:
getDistanceL1
in interfacePoint3D<Point3i,Vector3i>
- Parameters:
point
- the other point- Returns:
- the distance.
-
getDistanceLinf
@Pure public double getDistanceLinf(Point3D<?,?> point)
Description copied from interface:Point3D
Computes the L-infinite distance between this point and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2)].- Specified by:
getDistanceLinf
in interfacePoint3D<Point3i,Vector3i>
- Parameters:
point
- the other point- Returns:
- the distance.
-
getIdistanceL1
@Pure public int getIdistanceL1(Point3D<?,?> point)
Description copied from interface:Point3D
Computes the L-1 (Manhattan) distance between this point and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2) + abs(z1-z2).- Specified by:
getIdistanceL1
in interfacePoint3D<Point3i,Vector3i>
- Parameters:
point
- the other point- Returns:
- the distance.
-
getIdistanceLinf
@Pure public int getIdistanceLinf(Point3D<?,?> point)
Description copied from interface:Point3D
Computes the L-infinite distance between this point and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2)].- Specified by:
getIdistanceLinf
in interfacePoint3D<Point3i,Vector3i>
- Parameters:
point
- the other point- Returns:
- the distance.
-
add
public void add(Point3D<?,?> point, Vector3D<?,?> vector)
Description copied from interface:Point3D
Sets the value of this tuple to the sum of tuples t1 and t2.
-
add
public void add(Vector3D<?,?> vector, Point3D<?,?> point)
Description copied from interface:Point3D
Sets the value of this tuple to the sum of tuples t1 and t2.
-
add
public void add(Vector3D<?,?> vector)
Description copied from interface:Point3D
Sets the value of this tuple to the sum of itself and t1.
-
scaleAdd
public void scaleAdd(int scale, Vector3D<?,?> vector, Point3D<?,?> point)
Description copied from interface:Point3D
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<?,?> vector, Point3D<?,?> point)
Description copied from interface:Point3D
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, Point3D<?,?> point, Vector3D<?,?> vector)
Description copied from interface:Point3D
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, Point3D<?,?> point, Vector3D<?,?> vector)
Description copied from interface:Point3D
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:Point3D
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:Point3D
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(Point3D<?,?> point, Vector3D<?,?> vector)
Description copied from interface:Point3D
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:Point3D
Sets the value of this tuple to the difference of itself and t1 (this = this - t1).
-
getGeomFactory
public GeomFactory3i getGeomFactory()
Description copied from interface:Point3D
Replies the geometry factory associated to this point.- Specified by:
getGeomFactory
in interfacePoint3D<Point3i,Vector3i>
- Returns:
- the factory.
-
toUnmodifiable
@Pure public UnmodifiablePoint3D<Point3i,Vector3i> toUnmodifiable()
Description copied from interface:Point3D
Replies an unmodifiable copy of this vector.- Specified by:
toUnmodifiable
in interfacePoint3D<Point3i,Vector3i>
- Returns:
- an unmodifiable copy.
-
-