Package org.eclipse.draw2d.geometry
Class Ray
java.lang.Object
org.eclipse.draw2d.geometry.Ray
Deprecated, for removal: This API element is subject to removal in a future version.
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, 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.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.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 TypeMethodDescriptionint
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.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.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.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.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
hashCode()
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
length()
Deprecated, for removal: This API element is subject to removal in a future version.Returns the length of this Ray.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.toString()
Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Details
-
x
public int xDeprecated, for removal: This API element is subject to removal in a future version.the X value -
y
public int yDeprecated, 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
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
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 Pointend
- End Point- Since:
- 2.0
-
Ray
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 Rayend
- The end Ray- Since:
- 2.0
-
-
Method Details
-
assimilarity
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
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
Deprecated, for removal: This API element is subject to removal in a future version. -
getAdded
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
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
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. -
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
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
Deprecated, for removal: This API element is subject to removal in a future version.
-
Vector
instead, which offers double precision instead of integer precision.