Class Line3D

java.lang.Object
com.github.gbenroscience.math.geom.Line
com.github.gbenroscience.math.geom.Line3D

public class Line3D extends Line
Author:
GBEMIRO
  • Constructor Details

    • Line3D

      public Line3D(Line xyLine, Line xzLine)
      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 plane
      xzLine - The Line object that represents the image objects of this class produce on the XZ plane
    • Line3D

      public Line3D(Direction direction, Point point)
      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

      public Line3D(Point p1, Point p2)
      Parameters:
      p1 - A point through which the Line3D object passes.
      p2 - Another point through which the Line3D object passes.
  • Method Details

    • getXyLine

      public Line getXyLine()
      Returns:
      the XY plane image of objects of this class.
    • setXyLine

      public void setXyLine(Line xyLine)
      Parameters:
      xyLine - sets the XY plane image of objects of this class.
    • getXzLine

      public Line getXzLine()
      ]
      Returns:
      the XZ plane image of objects of this class.
    • setXzLine

      public void setXzLine(Line xzLine)
      Parameters:
      xzLine - sets the XZ plane image of objects of this class.
    • distance

      public double distance(Point p1, Point p2)
      Description copied from class: Line
      Finds 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:
      distance in class Line
      Parameters:
      p1 - the first Point object
      p2 - the second Point object
      Returns:
      the distance between the points.
    • distanceSquared

      public double distanceSquared(Point p1, Point p2)
      Description copied from class: Line
      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;
      Overrides:
      distanceSquared in class Line
      Parameters:
      p1 - the first Point object to consider
      p2 - the second Point object to consider
      Returns:
      the square of distance between the points.
    • direction

      public Direction 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

      public double angle(Line3D line)
      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

      public double angle(Plane plane)
      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

      public boolean passesThroughPoint(Point p1)
      Ascertains that a Line3D object passes through a given Point object
      Overrides:
      passesThroughPoint in class Line
      Parameters:
      p1 - the Point object.
      Returns:
      true if the Point object lies on this Line3D object
    • intersectsLine

      public boolean intersectsLine(Line line)
      Overrides:
      intersectsLine in class Line
      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

      public Point intersectionWithLine(Line line)
      Overrides:
      intersectionWithLine in class Line
      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

      public boolean isParallelTo(Line line)
      Description copied from class: Line
      Checks if this Line object is parallel to another.
      Overrides:
      isParallelTo in class Line
      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

      public boolean liesOn(Plane plane)
      Parameters:
      plane - the Plane object.
      Returns:
      true if this Line3D object lies on the given Plane object.
    • toString

      public String toString()
      Overrides:
      toString in class Line
    • main

      public static void main(String[] args)