|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itextpdf.text.pdf.parser.Vector
public class Vector
Represents a vector (i.e. a point in space). This class is completely
unrelated to the Vector class in the standard JRE.
For many PDF related operations, the z coordinate is specified as 1
This is to support the coordinate transformation calculations. If it
helps, just think of all PDF drawing operations as occurring in a single plane
with z=1.
| Field Summary | |
|---|---|
static int |
I1
index of the X coordinate |
static int |
I2
index of the Y coordinate |
static int |
I3
index of the Z coordinate |
| Constructor Summary | |
|---|---|
Vector(float x,
float y,
float z)
Creates a new Vector |
|
| Method Summary | |
|---|---|
Vector |
cross(Matrix by)
Computes the cross product of this vector and the specified matrix |
Vector |
cross(Vector with)
Computes the cross product of this vector and the specified vector |
float |
dot(Vector with)
Computes the dot product of this vector with the specified vector |
boolean |
equals(java.lang.Object obj)
|
float |
get(int index)
Gets the value from a coordinate of the vector |
int |
hashCode()
Calculates the hashcode using the values. |
float |
length()
Computes the length of this vector Note: If you are working with raw vectors from PDF, be careful - the Z axis will generally be set to 1. |
float |
lengthSquared()
Computes the length squared of this vector. |
Vector |
multiply(float by)
Multiplies the vector by a scalar |
Vector |
normalize()
Normalizes the vector (i.e. |
Vector |
subtract(Vector v)
Computes the difference between this vector and the specified vector |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int I1
public static final int I2
public static final int I3
| Constructor Detail |
|---|
public Vector(float x,
float y,
float z)
x - the X coordinatey - the Y coordinatez - the Z coordinate| Method Detail |
|---|
public float get(int index)
index - the index of the value to get (I1, I2 or I3)
public Vector cross(Matrix by)
by - the matrix to cross this vector with
public Vector subtract(Vector v)
v - the vector to subtract from this one
public Vector cross(Vector with)
with - the vector to cross this vector with
public Vector normalize()
public Vector multiply(float by)
by - the scalar to multiply by
public float dot(Vector with)
with - the vector to dot product this vector with
public float length()
aVector.subtract(originVector).length();
public float lengthSquared()
length()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||