Package org.joml
Class LineSegmentd
- java.lang.Object
-
- org.joml.LineSegmentd
-
- All Implemented Interfaces:
Externalizable,Serializable
public class LineSegmentd extends Object implements Externalizable
Represents an undirected line segment between two points.- Author:
- Kai Burjack
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description doubleaXThe x coordinate of the first point.doubleaYThe y coordinate of the first point.doubleaZThe z coordinate of the first point.doublebXThe x coordinate of the second point.doublebYThe y coordinate of the second point.doublebZThe z coordinate of the second point.
-
Constructor Summary
Constructors Constructor Description LineSegmentd()Create a newLineSegmentdof zero length on the point(0, 0, 0).LineSegmentd(double aX, double aY, double aZ, double bX, double bY, double bZ)Create a newLineSegmentdbetween the two points.LineSegmentd(LineSegmentd source)Create a newLineSegmentdas a copy of the givensource.LineSegmentd(Vector3dc a, Vector3dc b)Create a newLineSegmentdbetween the given two points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)inthashCode()voidreadExternal(ObjectInput in)StringtoString()Return a string representation of this line segment.StringtoString(NumberFormat formatter)Return a string representation of this line segment by formatting the vector components with the givenNumberFormat.voidwriteExternal(ObjectOutput out)
-
-
-
Field Detail
-
aX
public double aX
The x coordinate of the first point.
-
aY
public double aY
The y coordinate of the first point.
-
aZ
public double aZ
The z coordinate of the first point.
-
bX
public double bX
The x coordinate of the second point.
-
bY
public double bY
The y coordinate of the second point.
-
bZ
public double bZ
The z coordinate of the second point.
-
-
Constructor Detail
-
LineSegmentd
public LineSegmentd()
Create a newLineSegmentdof zero length on the point(0, 0, 0).
-
LineSegmentd
public LineSegmentd(LineSegmentd source)
Create a newLineSegmentdas a copy of the givensource.- Parameters:
source- theLineSegmentdto copy from
-
LineSegmentd
public LineSegmentd(Vector3dc a, Vector3dc b)
Create a newLineSegmentdbetween the given two points.- Parameters:
a- the first pointb- the second point
-
LineSegmentd
public LineSegmentd(double aX, double aY, double aZ, double bX, double bY, double bZ)Create a newLineSegmentdbetween the two points.- Parameters:
aX- the x coordinate of the first pointaY- the y coordinate of the first pointaZ- the z coordinate of the first pointbX- the x coordinate of the second pointbY- the y coordinate of the second pointbZ- the z coordinate of the second point
-
-
Method Detail
-
toString
public String toString()
Return a string representation of this line segment.This method creates a new
DecimalFormaton every invocation with the format string "0.000E0;-".
-
toString
public String toString(NumberFormat formatter)
Return a string representation of this line segment by formatting the vector components with the givenNumberFormat.- Parameters:
formatter- theNumberFormatused to format the vector components with- Returns:
- the string representation
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-