Class BigPoint

  • All Implemented Interfaces:
    java.lang.Comparable<BigPoint>

    @GwtCompatible
    final class BigPoint
    extends java.lang.Object
    implements java.lang.Comparable<BigPoint>
    A point consisting of BigDecimal coordinates.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.math.BigDecimal x  
      (package private) java.math.BigDecimal y  
      (package private) java.math.BigDecimal z  
    • Constructor Summary

      Constructors 
      Constructor Description
      BigPoint​(S2Point p)
      Creates a point of BigDecimal coordinates from a point of double coordinates.
      BigPoint​(java.math.BigDecimal x, java.math.BigDecimal y, java.math.BigDecimal z)
      Creates a point from the given BigDecimal coordinates.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(BigPoint p)  
      (package private) BigPoint crossProd​(BigPoint that)
      Returns the vector cross product of 'this' with 'that'.
      (package private) java.math.BigDecimal dotProd​(BigPoint that)
      Returns the vector dot product of 'this' with 'that'.
      (package private) java.math.BigDecimal dotProd​(S2Point that)
      Returns the vector dot product of 'this' with 'that'.
      boolean equals​(java.lang.Object that)  
      int hashCode()  
      (package private) boolean isAntipodal​(BigPoint p)
      Returns true iff this and 'p' are exactly anti-parallel, antipodal points.
      (package private) boolean isLinearlyDependent​(BigPoint p)
      Returns true iff this and 'p' are exactly parallel or anti-parallel.
      (package private) java.math.BigDecimal norm2()
      Returns the square of the magnitude of this vector.
      (package private) S2Point toS2Point()
      Returns an S2Point by rounding 'this' to double precision.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • x

        final java.math.BigDecimal x
      • y

        final java.math.BigDecimal y
      • z

        final java.math.BigDecimal z
    • Constructor Detail

      • BigPoint

        BigPoint​(S2Point p)
        Creates a point of BigDecimal coordinates from a point of double coordinates.
      • BigPoint

        BigPoint​(java.math.BigDecimal x,
                 java.math.BigDecimal y,
                 java.math.BigDecimal z)
        Creates a point from the given BigDecimal coordinates.
    • Method Detail

      • toS2Point

        S2Point toS2Point()
        Returns an S2Point by rounding 'this' to double precision.
      • crossProd

        BigPoint crossProd​(BigPoint that)
        Returns the vector cross product of 'this' with 'that'.
      • dotProd

        java.math.BigDecimal dotProd​(BigPoint that)
        Returns the vector dot product of 'this' with 'that'.
      • dotProd

        java.math.BigDecimal dotProd​(S2Point that)
        Returns the vector dot product of 'this' with 'that'.
      • isLinearlyDependent

        boolean isLinearlyDependent​(BigPoint p)
        Returns true iff this and 'p' are exactly parallel or anti-parallel.
      • isAntipodal

        boolean isAntipodal​(BigPoint p)
        Returns true iff this and 'p' are exactly anti-parallel, antipodal points.
      • norm2

        java.math.BigDecimal norm2()
        Returns the square of the magnitude of this vector.
      • compareTo

        public int compareTo​(BigPoint p)
        Specified by:
        compareTo in interface java.lang.Comparable<BigPoint>
      • equals

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

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