Class Ray

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

public final class Ray extends Object
Deprecated.
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.
    the X value
    int
    Deprecated.
    the Y value
  • Constructor Summary

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

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

    Methods inherited from class java.lang.Object

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

    • x

      public int x
      Deprecated.
      the X value
    • y

      public int y
      Deprecated.
      the Y value
  • Constructor Details

    • Ray

      public Ray()
      Deprecated.
      Constructs a Ray <0, 0> with no direction and magnitude.
      Since:
      2.0
    • Ray

      public Ray(int x, int y)
      Deprecated.
      Constructs a Ray pointed in the specified direction.
      Parameters:
      x - X value.
      y - Y value.
      Since:
      2.0
    • Ray

      public Ray(Point p)
      Deprecated.
      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.
      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.
      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.
      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.
      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.
      Overrides:
      equals in class Object
      See Also:
    • getAdded

      public Ray getAdded(Ray r)
      Deprecated.
      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.
      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.
      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.
      Overrides:
      hashCode in class Object
      See Also:
    • isHorizontal

      public boolean isHorizontal()
      Deprecated.
      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.
      Returns the length of this Ray.
      Returns:
      Length of this Ray
      Since:
      2.0
    • similarity

      public int similarity(Ray r)
      Deprecated.
      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.
      Overrides:
      toString in class Object
      Returns:
      a String representation