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.- @noreference
- This class is not intended to be referenced by clients.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionRay()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 SummaryModifier and TypeMethodDescriptionintassimilarity(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.intdotProduct(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.booleanDeprecated, 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.inthashCode()Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.Returns true if this Ray has a non-zero horizontal comonent.doublelength()Deprecated, for removal: This API element is subject to removal in a future version.Returns the length of this Ray.intsimilarity(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- 
xpublic int xDeprecated, for removal: This API element is subject to removal in a future version.the X value
- 
ypublic int yDeprecated, for removal: This API element is subject to removal in a future version.the Y value
 
- 
- 
Constructor Details- 
Raypublic 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
 
- 
Raypublic 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
 
- 
RayDeprecated, 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
 
- 
RayDeprecated, 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
 
- 
RayDeprecated, 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- 
assimilarityDeprecated, 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:
 
- 
dotProductDeprecated, 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
 
- 
equalsDeprecated, for removal: This API element is subject to removal in a future version.
- 
getAddedDeprecated, 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
 
- 
getAveragedDeprecated, 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
 
- 
getScaledDeprecated, 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
 
- 
hashCodepublic int hashCode()Deprecated, for removal: This API element is subject to removal in a future version.
- 
isHorizontalpublic 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
 
- 
lengthpublic 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
 
- 
similarityDeprecated, 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:
 
- 
toStringDeprecated, for removal: This API element is subject to removal in a future version.
 
- 
Vectorinstead, which offers double precision instead of integer precision.