Class Plane

java.lang.Object
com.github.gbenroscience.math.geom.Plane

public class Plane extends Object
Author:
GBEMIRO
  • Constructor Details

    • Plane

      public Plane(Point p1, Point p2, Point p3)
      Creates a Plane object given 3 points on it.
      Parameters:
      p1 - a point on the plane
      p2 - another point on the plane
      p3 - another point on the plane
    • Plane

      public Plane(Direction directionIndices, double planeConstant)
      Creates a Plane object given the direction indices of its normal vector (stored in a gameMath.Point object)
      Parameters:
      directionIndices - the direction indices of its normal vector
      planeConstant - the constant of the plane.
    • Plane

      public Plane(Line3D line1, Line3D line2)
      Creates the plane given 2 lines on it.
      Parameters:
      line1 - A line on the plane.
      line2 - Another line on the plane.
    • Plane

      public Plane(Line3D line, Point point)
      Parameters:
      line - a line that is normal to the Plane object.
      point - a Point on the Plane object
    • Plane

      public Plane(Direction dir, Point point)
      Parameters:
      dir - the direction vector of the plane.This is an object of class Direction.
      point - a Point on the Plane object
  • Method Details

    • getDirectionIndices

      public Direction getDirectionIndices()
      Returns:
      this Plane object's Direction attribute.
    • setDirectionIndices

      public void setDirectionIndices(Direction directionIndices)
      Parameters:
      directionIndices - sets this Plane object's Direction attribute
    • getPlaneConstant

      public double getPlaneConstant()
      Returns:
      the constant attribute of this Plane object
    • setPlaneConstant

      public void setPlaneConstant(double planeConstant)
      Parameters:
      planeConstant - sets the constant attribute of this Plane object
    • angleXY

      public double[] angleXY()
      Returns:
      the angle between this Plane object and the XY plane as an Array object of 2 double values.
    • angleXZ

      public double[] angleXZ()
      Returns:
      the angle between this Plane object and the XZ plane as an Array object of 2 double values.
    • angleYZ

      public double[] angleYZ()
      Returns:
      the angle between this Plane object and the YZ plane as an Array object of 2 double values.
    • angle

      public double angle(Plane plane)
      Parameters:
      plane - The angle this Plane object makes with another Plane object.
      Returns:
      the angle between the 2 Plane objects.
    • angle

      public double angle(Line3D line)
      Parameters:
      line - the Line3D object whose angle with this Plane object is desired.
      Returns:
      the angle between this Plane object and the Line3D object passed as a parameter to this method
    • getZ

      public double getZ(double x, double y)
      Parameters:
      x - the x coordinate of a Point object on this Plane object.
      y - the y coordinate of a Point object on this Plane object.
      Returns:
      the z coordinate of that Point object.
    • getY

      public double getY(double x, double z)
      Parameters:
      x - the x coordinate of a Point object on this Plane object.
      z - the z coordinate of a Point object on this Plane object.
      Returns:
      the y coordinate of that Point object.
    • getX

      public double getX(double y, double z)
      Parameters:
      y - the y coordinate of a Point object on this Plane object.
      z - the z coordinate of a Point object on this Plane object.
      Returns:
      the x coordinate of that Point object.
    • containsPoint

      public boolean containsPoint(Point point)
      Parameters:
      point - The Point object in consideration
      Returns:
      true if the Point object lies on this Plane object.
    • containsLine

      public boolean containsLine(Line3D lin)
      Parameters:
      lin - the Line3D object.
      Returns:
      true if the Line3D object lies on this Plane object.
    • intersectionWith

      public Point intersectionWith(Line3D line)
      Parameters:
      line - The Line3D object under consideration
      Returns:
      a Point object that contains the point of intersection of this Plane object and the given Line3D object.
    • intersectionWith

      public Line3D intersectionWith(Plane plane)
      Parameters:
      plane - The Plane object under consideration
      Returns:
      a Line3D object that contains the point of intersection of this Plane object and the given Line3D object.
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      the equation of this Plane object as a function of x,y,z.
    • approxEquals

      public boolean approxEquals(double val1, double val2)
      Compares two numbers to see if they are close enough to be almost the same It checks if the values deviate by 1.0E-14 or lesser.
      Parameters:
      val1 - the first value to compare
      val2 - the second value to compare
      Returns:
      true if the values deviate by 1.0E-14 or lesser.
    • approxEquals

      public boolean approxEquals(double val1, double val2, double minDeviation)
      Compares two numbers to see if they are close enough to be almost the same It checks if the values deviate by 1.0E-14 or lesser.
      Parameters:
      val1 - the first value to compare
      val2 - the second value to compare
      minDeviation - the minimum difference they must have to be acceptably equal.
      Returns:
      true if the values deviate by 1.0E-14 or lesser.
    • main

      public static void main(String[] args)