Class SegmentPoint3d
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d3.d.AbstractShape3d<SegmentPoint3d>
-
- org.arakhne.afc.math.geometry.d3.d.SegmentPoint3d
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Segment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
,Shape3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
,Shape3d<SegmentPoint3d>
,Shape3D<Shape3d<?>,SegmentPoint3d,PathIterator3afp<PathElement3d>,Point3d,Vector3d,RectangularPrism3d>
,JsonableObject
public class SegmentPoint3d extends AbstractShape3d<SegmentPoint3d> implements Segment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
A 3D segment/line encapsulating points with 3 double precision numbers.This segment is defined by its two extremities. It should not differ from the original Segment3d except from storage type.
- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Thomas PIOTROWSKI, Stéphane GALLAND, Hamza JAFFALI
- 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.afp.Segment3afp
Segment3afp.SegmentPathIterator<T extends PathElement3afp>, Segment3afp.UncertainIntersection
-
-
Constructor Summary
Constructors Constructor Description SegmentPoint3d()
Construct an empty segment.SegmentPoint3d(double x1, double y1, double z1, double x2, double y2, double z2)
Construct a segment from the two given points.SegmentPoint3d(Segment3afp<?,?,?,?,?,?> segment)
Constructor by copy.SegmentPoint3d(Point3d p1, Point3d p2)
Construct a segment from the two given points.SegmentPoint3d(SegmentPoint3d segment)
Constructor by copy.SegmentPoint3d(Point3D<?,?> p1, Point3D<?,?> p2)
Construct a segment from the two given points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SegmentPoint3d
createTransformedShape(Transform3D transform)
Apply the transformation to the shape and reply the result.Point3d
getP1()
Replies the first point.Point3d
getP2()
Replies the second point.double
getX1()
Replies the X of the first point.double
getX2()
Replies the X of the second point.double
getY1()
Replies the Y of the first point.double
getY2()
Replies the Y of the second point.double
getZ1()
Replies the Z of the first point.double
getZ2()
Replies the Z of the second point.int
hashCode()
void
set(double x1, double y1, double z1, double x2, double y2, double z2)
Change the line.void
setP1(double x, double y, double z)
Change the first point.void
setP1(Point3d point)
Sets the first point of the segment.void
setP2(double x, double y, double z)
Change the first point.void
setP2(Point3d point)
Sets the second point of the segment.void
setX1(double x)
Sets a new value in the X of the first point.void
setX2(double x)
Sets a new value in the X of the second point.void
setY1(double y)
Sets a new value in the Y of the first point.void
setY2(double y)
Sets a new value in the Y of the second point.void
setZ1(double z)
Sets a new value in the Z of the first point.void
setZ2(double z)
Sets a new value in the Z of the second point.-
Methods inherited from class org.arakhne.afc.math.geometry.d3.d.AbstractShape3d
addShapeGeometryChangeListener, clone, equals, fireGeometryChange, getGeomFactory, removeShapeGeometryChangeListener, 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.afp.Segment3afp
clear, clipToRectangle, contains, contains, equalsToShape, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getDistanceL1, getDistanceLinf, getDistanceSquared, getFarthestPointTo, getLength, getLengthSquared, getPathIterator, intersects, intersects, intersects, intersects, intersects, isEmpty, set, set, setP1, setP2, toBoundingBox, transform, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.afp.Shape3afp
contains, contains, getClosestPointTo, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, intersects, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.Shape3D
clone, equalsToPathIterator, getDistance, getDistance, getPathIterator, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo
-
-
-
-
Constructor Detail
-
SegmentPoint3d
public SegmentPoint3d()
Construct an empty segment.
-
SegmentPoint3d
public SegmentPoint3d(Point3D<?,?> p1, Point3D<?,?> p2)
Construct a segment from the two given points.- Parameters:
p1
- first point.p2
- second point.
-
SegmentPoint3d
public SegmentPoint3d(Point3d p1, Point3d p2)
Construct a segment from the two given points.- Parameters:
p1
- first point.p2
- second point.
-
SegmentPoint3d
public SegmentPoint3d(Segment3afp<?,?,?,?,?,?> segment)
Constructor by copy.- Parameters:
segment
- the segment to copy.
-
SegmentPoint3d
public SegmentPoint3d(SegmentPoint3d segment)
Constructor by copy.- Parameters:
segment
- the segment to copy.
-
SegmentPoint3d
public SegmentPoint3d(double x1, double y1, double z1, double x2, double y2, double z2)
Construct a segment from the two given points.- Parameters:
x1
- x coordinate of the first point.y1
- y coordinate of the first point.z1
- z coordinate of the first point.x2
- x coordinate of the second point.y2
- y coordinate of the second point.z2
- z coordinate of the second point.
-
-
Method Detail
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCode
in classAbstractShape3d<SegmentPoint3d>
-
createTransformedShape
@Pure public SegmentPoint3d createTransformedShape(Transform3D transform)
Description copied from interface:Shape3D
Apply the transformation to the shape and reply the result. This function does not change the current shape.- Specified by:
createTransformedShape
in interfaceShape3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Specified by:
createTransformedShape
in interfaceShape3D<Shape3d<?>,SegmentPoint3d,PathIterator3afp<PathElement3d>,Point3d,Vector3d,RectangularPrism3d>
- Parameters:
transform
- is the transformation to apply to the shape.- Returns:
- the result of the transformation.
-
set
public void set(double x1, double y1, double z1, double x2, double y2, double z2)
Description copied from interface:Segment3afp
Change the line.- Specified by:
set
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Parameters:
x1
- x coordinate of the first point.y1
- y coordinate of the first point.z1
- z coordinate of the first point.x2
- x coordinate of the second point.y2
- y coordinate of the second point.z2
- z coordinate of the second point.
-
getX1
@Pure public double getX1()
Description copied from interface:Segment3afp
Replies the X of the first point.- Specified by:
getX1
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Returns:
- the x of the first point.
-
setX1
public void setX1(double x)
Description copied from interface:Segment3afp
Sets a new value in the X of the first point.- Specified by:
setX1
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Parameters:
x
- the new value double x
-
getY1
@Pure public double getY1()
Description copied from interface:Segment3afp
Replies the Y of the first point.- Specified by:
getY1
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Returns:
- the y of the first point.
-
setY1
public void setY1(double y)
Description copied from interface:Segment3afp
Sets a new value in the Y of the first point.- Specified by:
setY1
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Parameters:
y
- the new value double y
-
getZ1
@Pure public double getZ1()
Description copied from interface:Segment3afp
Replies the Z of the first point.- Specified by:
getZ1
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Returns:
- the z of the first point.
-
setZ1
public void setZ1(double z)
Description copied from interface:Segment3afp
Sets a new value in the Z of the first point.- Specified by:
setZ1
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Parameters:
z
- the new value double z
-
getX2
@Pure public double getX2()
Description copied from interface:Segment3afp
Replies the X of the second point.- Specified by:
getX2
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Returns:
- the x of the second point.
-
setX2
public void setX2(double x)
Description copied from interface:Segment3afp
Sets a new value in the X of the second point.- Specified by:
setX2
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Parameters:
x
- the new value double x
-
getY2
@Pure public double getY2()
Description copied from interface:Segment3afp
Replies the Y of the second point.- Specified by:
getY2
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Returns:
- the y of the second point.
-
setY2
public void setY2(double y)
Description copied from interface:Segment3afp
Sets a new value in the Y of the second point.- Specified by:
setY2
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Parameters:
y
- the new value double y
-
getZ2
@Pure public double getZ2()
Description copied from interface:Segment3afp
Replies the Z of the second point.- Specified by:
getZ2
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Returns:
- the z of the second point.
-
setZ2
public void setZ2(double z)
Description copied from interface:Segment3afp
Sets a new value in the Z of the second point.- Specified by:
setZ2
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Parameters:
z
- the new value double z
-
getP1
public Point3d getP1()
Description copied from interface:Segment3afp
Replies the first point.- Specified by:
getP1
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Returns:
- the first point.
-
setP1
public void setP1(double x, double y, double z)
Description copied from interface:Segment3afp
Change the first point.- Specified by:
setP1
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Parameters:
x
- x coordinate of the first point.y
- y coordinate of the first point.z
- z coordinate of the first point.
-
setP1
public void setP1(Point3d point)
Sets the first point of the segment.- Parameters:
point
- the point to set.
-
getP2
public Point3d getP2()
Description copied from interface:Segment3afp
Replies the second point.- Specified by:
getP2
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Returns:
- the second point.
-
setP2
public void setP2(double x, double y, double z)
Description copied from interface:Segment3afp
Change the first point.- Specified by:
setP2
in interfaceSegment3afp<Shape3d<?>,SegmentPoint3d,PathElement3d,Point3d,Vector3d,RectangularPrism3d>
- Parameters:
x
- x coordinate of the first point.y
- y coordinate of the first point.z
- z coordinate of the first point.
-
setP2
public void setP2(Point3d point)
Sets the second point of the segment.- Parameters:
point
- the point to set.
-
-