Class Line3D
java.lang.Object
com.github.gbenroscience.math.geom.Line
com.github.gbenroscience.math.geom.Line3D
- Author:
- GBEMIRO
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubledoubledoubleFinds the distance between 2 Point objects lying on this Line object They must lie on this Line object, else the method will return 0;doubledistanceSquared(Point p1, Point p2) Finds the square of the distance between 2 Point objects lying on this Line object They must lie on this Line object, else the method will return 0;doubledoubledoubledouble]intersectionWithLine(Line line) booleanintersectsLine(Line line) booleanisParallelTo(Line line) Checks if this Line object is parallel to another.booleanstatic voidbooleanAscertains that a Line3D object passes through a given Point objectvoidvoidtoString()Methods inherited from class com.github.gbenroscience.math.geom.Line
approxEquals, approxEquals, convertRectangleToPolygon, draw, getC, getM, getParallelLineAtDistance, getParallelLineAtDistance, getX, getxValue, getY, isVertical, polygonArea, polygonIntersects, polygonIntersects, polygonIntersectsNew, rotate, rotateLine, setC, setM
-
Constructor Details
-
Line3D
Creates a 3D line having 2 line attributes. The lines are the images produced by objects of this class on the x,y,z planes.- Parameters:
xyLine- The Line object that represents the image objects of this class produce on the XY planexzLine- The Line object that represents the image objects of this class produce on the XZ plane
-
Line3D
Creates a new Line object given a point through which it passes and the direction coordinates of the Line object.- Parameters:
direction- A Point object that stores the direction coordinates of this object.point- A point through which this Line passes
-
Line3D
-
-
Method Details
-
getXyLine
- Returns:
- the XY plane image of objects of this class.
-
setXyLine
- Parameters:
xyLine- sets the XY plane image of objects of this class.
-
getXzLine
-
setXzLine
- Parameters:
xzLine- sets the XZ plane image of objects of this class.
-
distance
Description copied from class:LineFinds the distance between 2 Point objects lying on this Line object They must lie on this Line object, else the method will return 0; -
distanceSquared
Description copied from class:LineFinds the square of the distance between 2 Point objects lying on this Line object They must lie on this Line object, else the method will return 0;- Overrides:
distanceSquaredin classLine- Parameters:
p1- the first Point object to considerp2- the second Point object to consider- Returns:
- the square of distance between the points.
-
direction
- Returns:
- the Direction object that specifies this line's direction in space. the coordinates of the Direction object are eexpressed relative to the x coordinate so the x coordinate is always 1.
-
angle
- Parameters:
line- the Line object whose angle with this Line object is needed- Returns:
- the angle this Line object makes with another Line object
-
getLINEXYGrad
public double getLINEXYGrad()- Returns:
- the gradient of this object's image line on the xy plane
-
getLINEXYIntercept
public double getLINEXYIntercept()- Returns:
- the y intercept of this object's image line on the xy plane
-
getLINEXZGrad
public double getLINEXZGrad()- Returns:
- the gradient of this object's image line on the xz plane
-
getLINEXZIntercept
public double getLINEXZIntercept()- Returns:
- the z intercept of this object's image line on the xz plane
-
angle
- Parameters:
plane- the Line object whose angle with this Line object is needed- Returns:
- the angle this Line object makes with another Plane object
-
passesThroughPoint
Ascertains that a Line3D object passes through a given Point object- Overrides:
passesThroughPointin classLine- Parameters:
p1- the Point object.- Returns:
- true if the Point object lies on this Line3D object
-
intersectsLine
- Overrides:
intersectsLinein classLine- Parameters:
line- the Line3D object to check whether or not it intersects with this Line object- Returns:
- true if this Line3D object interferes with the Line3D object passed to its method as a parameter.
-
intersectionWithLine
- Overrides:
intersectionWithLinein classLine- Parameters:
line- the Line3D object whose intersection with this Line3D object is desired.- Returns:
- a Point object containing the point of intersection of both Lines.
-
isParallelTo
Description copied from class:LineChecks if this Line object is parallel to another.- Overrides:
isParallelToin classLine- Parameters:
line- the Line object to be checked against this one for parallelism- Returns:
- true if it is parallel to the other Line object
-
liesOn
- Parameters:
plane- the Plane object.- Returns:
- true if this Line3D object lies on the given Plane object.
-
toString
-
main
-