Class JavaLine3D
- java.lang.Object
-
- science.aist.imaging.api.domain.AbstractJavaLine<JavaPoint3D>
-
- science.aist.imaging.api.domain.threedimensional.JavaLine3D
-
public class JavaLine3D extends AbstractJavaLine<JavaPoint3D>
Threedimensional line between two 3D points
- Since:
- 1.0
- Author:
- Christoph Praschl
-
-
Field Summary
-
Fields inherited from class science.aist.imaging.api.domain.AbstractJavaLine
endPoint, startPoint
-
-
Constructor Summary
Constructors Constructor Description JavaLine3D(double x1, double y1, double z1, double x2, double y2, double z2)
JavaLine3D(JavaPoint3D startPoint, JavaPoint3D endPoint)
set line by start and end point
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JavaPoint3D
calculateCenterPoint()
Calculate the center point of a given line
x = (start.x + end.x) / 2
y = (start.y + end.y) / 2
z = (start.z + end.z) / 2JavaPoint3D
getPointAlongLine(double distance)
Method for getting a point along this line with the given distance from the startPoint (Based on https://math.stackexchange.com/questions/175896/finding-a-point-along-a-line-a-certain-distance-away-from-another-point)-
Methods inherited from class science.aist.imaging.api.domain.AbstractJavaLine
getInterpolatedPoints, getInterpolatedPoints, getLineDirection, length
-
-
-
-
Constructor Detail
-
JavaLine3D
public JavaLine3D(double x1, double y1, double z1, double x2, double y2, double z2)
-
JavaLine3D
public JavaLine3D(JavaPoint3D startPoint, JavaPoint3D endPoint)
set line by start and end point- Parameters:
startPoint
- the start point of the lineendPoint
- the end point of the line
-
-
Method Detail
-
calculateCenterPoint
protected JavaPoint3D calculateCenterPoint()
Calculate the center point of a given line
x = (start.x + end.x) / 2
y = (start.y + end.y) / 2
z = (start.z + end.z) / 2- Specified by:
calculateCenterPoint
in classAbstractJavaLine<JavaPoint3D>
- Returns:
- center point of the line
-
getPointAlongLine
public JavaPoint3D getPointAlongLine(double distance)
Method for getting a point along this line with the given distance from the startPoint (Based on https://math.stackexchange.com/questions/175896/finding-a-point-along-a-line-a-certain-distance-away-from-another-point)- Specified by:
getPointAlongLine
in classAbstractJavaLine<JavaPoint3D>
- Parameters:
distance
- from the startPoint- Returns:
- the point with the given distance
-
-