Eclipse Draw2d 3.3

## org.eclipse.draw2d.geometry
Class Ray

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

Deprecated. Use `Vector` instead, which offers double precision instead of integer precision.

    public final class Ray

extends Object

Represents a 2-dimensional directional Vector, or Ray. `Vector` is commonly imported, so the name Ray was chosen.

Field Summary
`int` `x` Deprecated. the X value
`int` `y` Deprecated. the Y value

Constructor Summary
`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.
`Ray(Point p)` 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
`int` `assimilarity(Ray r)` Deprecated. Calculates the magnitude of the cross product of this Ray with another.
`int` `dotProduct(Ray r)` Deprecated. Calculates the dot product of this Ray with another.
`boolean` `equals(Object obj)` Deprecated.
`Ray` `getAdded(Ray r)` Deprecated. Creates a new Ray which is the sum of this Ray with another.
`Ray` `getAveraged(Ray r)` Deprecated. Creates a new Ray which represents the average of this Ray with another.
`Ray` `getScaled(int s)` Deprecated. Creates a new Ray which represents this Ray scaled by the amount provided.
`int` `hashCode()` Deprecated.
`boolean` `isHorizontal()` Deprecated. Returns true if this Ray has a non-zero horizontal comonent.
`double` `length()` Deprecated. Returns the length of this Ray.
`int` `similarity(Ray r)` Deprecated. Calculates the similarity of this Ray with another.
`String` `toString()` Deprecated.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### x

    public int x

  Deprecated.
  the X value

### y

    public int y

  Deprecated.
  the Y value

Constructor Detail

### 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 Detail

### 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:
    `similarity(Ray)`

### 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:
    `Object.equals(Object)`

### 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:
    `Object.hashCode()`

### 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:
    `assimilarity(Ray)`

### toString

    public String toString()

  Deprecated.
  Overrides:
    `toString` in class `Object`
  Returns:
    a String representation

Eclipse Draw2d 3.3

Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.