Class V3D_Point

java.lang.Object
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<V3D_Point>, V3D_FiniteGeometry

public class V3D_Point
extends V3D_Geometry
implements java.lang.Comparable<V3D_Point>, V3D_FiniteGeometry
V3D_Point
Version:
1.0
Author:
Andy Turner
See Also:
Serialized Form
  • Field Summary

    Fields 
    Modifier and Type Field Description
    ch.obermuhlner.math.big.BigRational x
    The x coordinate.
    ch.obermuhlner.math.big.BigRational y
    The y coordinate.
    ch.obermuhlner.math.big.BigRational z
    The z coordinate.

    Fields inherited from class uk.ac.leeds.ccg.v3d.core.V3D_Object

    e
  • Constructor Summary

    Constructors 
    Constructor Description
    V3D_Point​(V3D_Environment e, ch.obermuhlner.math.big.BigRational x, ch.obermuhlner.math.big.BigRational y, ch.obermuhlner.math.big.BigRational z)  
    V3D_Point​(V3D_Point p)  
  • Method Summary

    Modifier and Type Method Description
    V3D_Point apply​(V3D_Vector v)  
    int compareTo​(V3D_Point o)
    Order first in terms of x, then y, then z.
    boolean equals​(java.lang.Object o)  
    java.math.BigDecimal getDistance​(V3D_Line l, int scale, java.math.RoundingMode rm)
    Get the distance between this and l.
    java.math.BigDecimal getDistance​(V3D_Plane pl, int scale, java.math.RoundingMode rm)
    Get the distance between this and pl.
    java.math.BigDecimal getDistance​(V3D_Point p, int scale, java.math.RoundingMode rm)
    Get the distance between this and p.
    ch.obermuhlner.math.big.BigRational getDistanceSquared​(V3D_Point p)
    Get the distance squared between this and p.
    V3D_Envelope getEnvelope()  
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • x

      public ch.obermuhlner.math.big.BigRational x
      The x coordinate.
    • y

      public ch.obermuhlner.math.big.BigRational y
      The y coordinate.
    • z

      public ch.obermuhlner.math.big.BigRational z
      The z coordinate.
  • Constructor Details

    • V3D_Point

      public V3D_Point​(V3D_Point p)
      Parameters:
      p - The point to duplicate
    • V3D_Point

      public V3D_Point​(V3D_Environment e, ch.obermuhlner.math.big.BigRational x, ch.obermuhlner.math.big.BigRational y, ch.obermuhlner.math.big.BigRational z)
      Parameters:
      e - What V3D_Object.e is set to.
      x - What x is set to.
      y - What y is set to.
      z - What z is set to.
  • Method Details

    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • apply

      public V3D_Point apply​(V3D_Vector v)
      Parameters:
      v - The vector to apply.
      Returns:
      a new point which is this shifted by v.
    • getDistance

      public java.math.BigDecimal getDistance​(V3D_Point p, int scale, java.math.RoundingMode rm)
      Get the distance between this and p.
      Parameters:
      p - A point.
      scale - The scale. A positive value gives the number of decimal places. A negative value rounds to the left of the decimal point.
      rm - The RoundingMode for the calculation.
      Returns:
      The distance from p to this.
    • getDistanceSquared

      public ch.obermuhlner.math.big.BigRational getDistanceSquared​(V3D_Point p)
      Get the distance squared between this and p.
      Parameters:
      p - A point.
      Returns:
      The distance squared from p to this.
    • getDistance

      public java.math.BigDecimal getDistance​(V3D_Line l, int scale, java.math.RoundingMode rm)
      Get the distance between this and l.
      Parameters:
      l - A line.
      scale - The scale. A positive value gives the number of decimal places. A negative value rounds to the left of the decimal point.
      rm - The RoundingMode for the calculation.
      Returns:
      The distance from p to this.
    • getDistance

      public java.math.BigDecimal getDistance​(V3D_Plane pl, int scale, java.math.RoundingMode rm)
      Get the distance between this and pl.
      Parameters:
      pl - A plane.
      scale - The scale. A positive value gives the number of decimal places. A negative value rounds to the left of the decimal point.
      rm - The RoundingMode for the calculation.
      Returns:
      The distance from p to this.
    • getEnvelope

      public V3D_Envelope getEnvelope()
      Specified by:
      getEnvelope in interface V3D_FiniteGeometry
    • compareTo

      public int compareTo​(V3D_Point o)
      Order first in terms of x, then y, then z.
      Specified by:
      compareTo in interface java.lang.Comparable<V3D_Point>
      Parameters:
      o - The point to compare with.
      Returns:
      -1, 0, 1 depending on if this is less than equal to or greater than o.