Class Point_3

java.lang.Object
Jcg.geometry.Point_3
All Implemented Interfaces:
Comparable<Point_>, Point_

public class Point_3 extends Object implements Point_
  • Field Details

  • Constructor Details

  • Method Details

    • barycenter

      public void barycenter(Point_[] points)
      Set the current point as the barycenter of an array of points
      Specified by:
      barycenter in interface Point_
    • linearCombination

      public void linearCombination(Point_[] points, Number[] coefficients)
      Description copied from interface: Point_
      Set the current point a linear combination of an array of points. Coefficients must sum to 1
      Specified by:
      linearCombination in interface Point_
    • linearCombination

      public static Point_3 linearCombination(Point_3[] points, Number[] coefficients)
    • getX

      public Number getX()
    • setX

      public void setX(Number x)
    • getY

      public Number getY()
    • setY

      public void setY(Number y)
    • getZ

      public Number getZ()
    • setZ

      public void setZ(Number z)
    • translateOf

      public void translateOf(Vector_ v)
      Description copied from interface: Point_
      Translate the current point according to a vector v
      Specified by:
      translateOf in interface Point_
    • multiply

      public void multiply(Number n)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • distanceFrom

      public Number distanceFrom(Point_3 p)
    • squareDistance

      public Number squareDistance(Point_ p)
      Description copied from interface: Point_
      Return the square distance ||p-q||^2, where q is the current point
      Specified by:
      squareDistance in interface Point_
    • toString

      public String toString()
      Description copied from interface: Point_
      Return a string (representation of the point)
      Specified by:
      toString in interface Point_
      Overrides:
      toString in class Object
    • dimension

      public int dimension()
      Description copied from interface: Point_
      Return the dimension of the space
      Specified by:
      dimension in interface Point_
    • getCartesian

      public Number getCartesian(int i)
      Description copied from interface: Point_
      return the i-th cartesian coordinate of the point
      Specified by:
      getCartesian in interface Point_
    • setCartesian

      public void setCartesian(int i, Number x)
      Description copied from interface: Point_
      set the i-th cartesian coordinate
      Specified by:
      setCartesian in interface Point_
    • setOrigin

      public void setOrigin()
      Description copied from interface: Point_
      set the coordinates of the origin
      Specified by:
      setOrigin in interface Point_
    • minus

      public Vector_ minus(Point_ b)
      Description copied from interface: Point_
      Return the vector (p-q), where q is the current point
      Specified by:
      minus in interface Point_
    • sum

      public Point_3 sum(Vector_ v)
    • compareTo

      public int compareTo(Point_ o)
      Compare two points (lexicographic order on coordinates)
      Specified by:
      compareTo in interface Comparable<Point_>
      Parameters:
      o - the point to compare
    • compareCartesian

      public int compareCartesian(Point_ o, int i)
      Compare the i-th coordinate of two points
      Specified by:
      compareCartesian in interface Point_
      Parameters:
      o - the point to compare
      i - the i-th coordinate to compare
      Returns:
      the result is -1 if first point is smaller then point o, return 1 is first point is greater then o, and 0 otherwise