|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umd.cfar.lamp.viper.geometry.Component
Represents a homogonous vector. Represented as Rationals.
Field Summary | |
Rational |
t
The homogonizing scalar. |
Rational |
x
The first scalar in the vector, representing the x dimension. |
Rational |
y
The second scalar in the vector, representing the y dimension. |
Constructor Summary | |
Component()
Constructs a new Component. |
|
Component(Component C)
Constructs a new Component from the given Component. |
|
Component(int X,
int Y,
int T)
Constructs a new Component with the given coordinates. |
|
Component(Rational X,
Rational Y,
Rational T)
Constructs a new Component with the given coordinates in Rationals. |
Method Summary | |
static Rational |
dot(Component a,
Component b)
Returns the dot product of the two input vectors. |
boolean |
equals(java.lang.Object o)
Tests the equality of this with another Component. |
int |
hashCode()
Generates a hash code for this object. |
double |
length()
Determine the length of the Component as a double . |
Component |
minus(Component C)
Subtract another Component from this Component. |
Component |
plus(Component C)
Add another Component to this. |
Component |
set(Component C)
Sets this component to the given value. |
java.lang.String |
toString()
Get a String representing this component. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public Rational x
public Rational y
public Rational t
Constructor Detail |
public Component()
public Component(Rational X, Rational Y, Rational T)
X
- The x coordinate.Y
- The y coordinate.T
- The homogonous coordinate.public Component(int X, int Y, int T)
X
- The x coordinate.Y
- The y coordinate.T
- The homogonous coordinate.public Component(Component C)
C
- The Component to copy.Method Detail |
public Component set(Component C)
C
- The value to set this to.
public boolean equals(java.lang.Object o)
o
- The object to test against this Component.
true
if these are equal.public int hashCode()
public static Rational dot(Component a, Component b)
a.x * b.x + a.y * b.y
a
- A Component to do some math on.b
- A component to do some math on.
public Component minus(Component C)
C
- A Component to subtract from this.
public Component plus(Component C)
C
- The Component to add to this.
java.lang.ArithmeticException
- if you try to add two points or something.public double length()
double
.
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |