| java.lang.Object | |
| ↳ | com.pdftron.pdf.utils.Vec2 |
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
Vec2()
Empty constructor, initializes to 0
| |||||||||||
|
Vec2(double x, double y)
Creates an instance of the Vec2 class and initializes x and y
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static Vec2 | add(Vec2 vec1, Vec2 vec2) | ||||||||||
| void |
add(Vec2 vec)
Adds to this Vec2 the values of another
| ||||||||||
| void | addX(Vec2 vec) | ||||||||||
| void | addY(Vec2 vec) | ||||||||||
| static Vec2 | divide(Vec2 vec1, Vec2 vec2) | ||||||||||
| static Vec2 | divide(Vec2 vec1, double val) | ||||||||||
| float |
dot(Vec2 vec)
Calculates the dot product of this Vec2 with another
| ||||||||||
| boolean | equals(Object obj) | ||||||||||
| Vec2 |
getIntValue()
Gets a Vec2 with the truncated values of the float coordinates
| ||||||||||
| Vec2 | getPerp() | ||||||||||
| Vec2 |
getVectorTo(Vec2 point)
Returns a vector from this to the point provided
| ||||||||||
| Vec2 | getVectorTo(int x, int y) | ||||||||||
| double |
length()
Calculates the vector length
| ||||||||||
| static Vec2 | multiply(Vec2 vec1, double val) | ||||||||||
| static Vec2 | multiply(Vec2 vec1, Vec2 vec2) | ||||||||||
| Vec2 |
normalize()
Normalizes the vector
| ||||||||||
| Vec2 | normalized() | ||||||||||
| void |
offset(double x, double y)
Adds the offset to the current position
| ||||||||||
| boolean |
roundEqual(Vec2 vec)
Checks if the rounded coordinates of both vectors are equal
| ||||||||||
| void |
scale(float val)
Multiplies the x and y components by the value
| ||||||||||
| void |
set(double x, double y)
Sets the x,y
| ||||||||||
| void |
setX(double x)
Sets the x
| ||||||||||
| void |
setY(double y)
Sets the y
| ||||||||||
| static Vec2 | subtract(Vec2 vec1, Vec2 vec2) | ||||||||||
| void |
subtract(Vec2 vec)
Subtracts to this Vec2 the values of another
| ||||||||||
| void | subtractX(Vec2 vec) | ||||||||||
| void | subtractY(Vec2 vec) | ||||||||||
| PointF | toPointF() | ||||||||||
| double |
x()
Gets the x value
| ||||||||||
| double |
y()
Gets the y value
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Empty constructor, initializes to 0
Creates an instance of the Vec2 class and initializes x and y
Calculates the dot product of this Vec2 with another
| vec | Vec2 to do the product with |
|---|
Gets a Vec2 with the truncated values of the float coordinates
Returns a vector from this to the point provided
| point | to calculate the vector to |
|---|
Calculates the vector length
Adds the offset to the current position
| x | to add to the x component |
|---|---|
| y | to add to the y component |
Checks if the rounded coordinates of both vectors are equal
| vec | Vec2 to check against |
|---|
Multiplies the x and y components by the value
| val | Multiplier for the components |
|---|
Sets the x,y
Sets the x
Sets the y
Subtracts to this Vec2 the values of another
| vec | Vec2 to subtract |
|---|
Gets the x value
Gets the y value