Vector
instead, which offers double precision instead
of integer precision.public final class Ray
extends java.lang.Object
Vector
is commonly imported, so the name Ray was chosen.Modifier and Type | Field and Description |
---|---|
int |
x
Deprecated.
the X value
|
int |
y
Deprecated.
the Y value
|
Constructor and 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.
|
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.
|
Modifier and Type | Method and Description |
---|---|
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(java.lang.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.
|
java.lang.String |
toString()
Deprecated.
|
public Ray()
public Ray(int x, int y)
x
- X value.y
- Y value.public Ray(Point p)
p
- the Pointpublic Ray(Point start, Point end)
start
- Strarting Pointend
- End Pointpublic int assimilarity(Ray r)
r
- Ray being comparedsimilarity(Ray)
public int dotProduct(Ray r)
r
- the Ray used to perform the dot productpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(Object)
public Ray getAdded(Ray r)
r
- Ray to be added with this Raypublic Ray getAveraged(Ray r)
r
- Ray to calculate the average.public Ray getScaled(int s)
s
- Value providing the amount to scale.public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean isHorizontal()
public double length()
public int similarity(Ray r)
r
- Ray being tested for similarityassimilarity(Ray)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.