Package org.eclipse.draw2d.geometry
Class Ray
java.lang.Object
org.eclipse.draw2d.geometry.Ray
Deprecated.
Represents a 2-dimensional directional Vector, or Ray.
Vector
is commonly imported, so the name Ray was chosen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRay()
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.Deprecated.Constructs a Ray representing the direction and magnitude between to provided Points.Deprecated.Constructs a Ray representing the difference between two provided Rays. -
Method Summary
Modifier and TypeMethodDescriptionint
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
Deprecated.Deprecated.Creates a new Ray which is the sum of this Ray with another.getAveraged
(Ray r) 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
hashCode()
Deprecated.boolean
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.toString()
Deprecated.
-
Field Details
-
x
public int xDeprecated.the X value -
y
public int yDeprecated.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
Deprecated.Constructs a Ray pointed in the direction specified by a Point.- Parameters:
p
- the Point- Since:
- 2.0
-
Ray
Deprecated.Constructs a Ray representing the direction and magnitude between to provided Points.- Parameters:
start
- Strarting Pointend
- End Point- Since:
- 2.0
-
Ray
Deprecated.Constructs a Ray representing the difference between two provided Rays.- Parameters:
start
- The start Rayend
- The end Ray- Since:
- 2.0
-
-
Method Details
-
assimilarity
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
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
Deprecated. -
getAdded
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
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
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. -
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
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
Deprecated.
-
Vector
instead, which offers double precision instead of integer precision.