Class Ray

java.lang.Object
org.eclipse.draw2d.geometry.Ray

@Deprecated(since="3.5", forRemoval=true) public final class Ray extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use Vector instead, which offers double precision instead of integer precision.
Represents a 2-dimensional directional Vector, or Ray. Vector is commonly imported, so the name Ray was chosen.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    the X value
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    the Y value
  • Constructor Summary

    Constructors
    Constructor
    Description
    Ray()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a Ray <0, 0> with no direction and magnitude.
    Ray(int x, int y)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a Ray pointed in the specified direction.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a Ray pointed in the direction specified by a Point.
    Ray(Point start, Point end)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a Ray representing the direction and magnitude between to provided Points.
    Ray(Ray start, Ray end)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a Ray representing the difference between two provided Rays.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Calculates the magnitude of the cross product of this Ray with another.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Calculates the dot product of this Ray with another.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new Ray which is the sum of this Ray with another.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new Ray which represents the average of this Ray with another.
    getScaled(int s)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new Ray which represents this Ray scaled by the amount provided.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if this Ray has a non-zero horizontal comonent.
    double
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the length of this Ray.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Calculates the similarity of this Ray with another.
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

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

    • x

      public int x
      Deprecated, for removal: This API element is subject to removal in a future version.
      the X value
    • y

      public int y
      Deprecated, for removal: This API element is subject to removal in a future version.
      the Y value
  • Constructor Details

    • Ray

      public Ray()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a Ray <0, 0> with no direction and magnitude.
      Since:
      2.0
    • Ray

      public Ray(int x, int y)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a Ray pointed in the specified direction.
      Parameters:
      x - X value.
      y - Y value.
      Since:
      2.0
    • Ray

      public Ray(Point p)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a Ray pointed in the direction specified by a Point.
      Parameters:
      p - the Point
      Since:
      2.0
    • Ray

      public Ray(Point start, Point end)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a Ray representing the direction and magnitude between to provided Points.
      Parameters:
      start - Strarting Point
      end - End Point
      Since:
      2.0
    • Ray

      public Ray(Ray start, Ray end)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a Ray representing the difference between two provided Rays.
      Parameters:
      start - The start Ray
      end - The end Ray
      Since:
      2.0
  • Method Details

    • assimilarity

      public int assimilarity(Ray r)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Calculates the magnitude of the cross product of this Ray with another. Represents the amount by which two Rays are directionally different. Parallel Rays return a value of 0.
      Parameters:
      r - Ray being compared
      Returns:
      The assimilarity
      Since:
      2.0
      See Also:
    • dotProduct

      public int dotProduct(Ray r)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Calculates the dot product of this Ray with another.
      Parameters:
      r - the Ray used to perform the dot product
      Returns:
      The dot product
      Since:
      2.0
    • equals

      public boolean equals(Object obj)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      equals in class Object
      See Also:
    • getAdded

      public Ray getAdded(Ray r)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new Ray which is the sum of this Ray with another.
      Parameters:
      r - Ray to be added with this Ray
      Returns:
      a new Ray
      Since:
      2.0
    • getAveraged

      public Ray getAveraged(Ray r)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new Ray which represents the average of this Ray with another.
      Parameters:
      r - Ray to calculate the average.
      Returns:
      a new Ray
      Since:
      2.0
    • getScaled

      public Ray getScaled(int s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new Ray which represents this Ray scaled by the amount provided.
      Parameters:
      s - Value providing the amount to scale.
      Returns:
      a new Ray
      Since:
      2.0
    • hashCode

      public int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      hashCode in class Object
      See Also:
    • isHorizontal

      public boolean isHorizontal()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if this Ray has a non-zero horizontal comonent.
      Returns:
      true if this Ray has a non-zero horizontal comonent
      Since:
      2.0
    • length

      public double length()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the length of this Ray.
      Returns:
      Length of this Ray
      Since:
      2.0
    • similarity

      public int similarity(Ray r)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Calculates the similarity of this Ray with another. Similarity is defined as the absolute value of the dotProduct()
      Parameters:
      r - Ray being tested for similarity
      Returns:
      the Similarity
      Since:
      2.0
      See Also:
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object
      Returns:
      a String representation