Class Vector2i
Inheritance
java.lang.Object
Vector2i
Syntax
Constructors
Vector2i()
Create a new Vector2i and initialize its components to zero.
Declaration
Vector2i(int s)
Create a new Vector2i and initialize both of its components with the given value.
Declaration
Parameters
Type |
Name |
Description |
int |
s |
the value of both components
|
Vector2i(int x, int y)
Create a new Vector2i and initialize its components to the given values.
Declaration
public Vector2i(int x, int y)
Parameters
Type |
Name |
Description |
int |
x |
the x component
|
int |
y |
the y component
|
Vector2i(Vector2i v)
Create a new Vector2i and initialize its components to the one of the given vector.
Declaration
public Vector2i(Vector2i v)
Parameters
Type |
Name |
Description |
Vector2i |
v |
the Vector2ic to copy the values from
|
Methods
add(int x, int y)
Declaration
public Vector2i add(int x, int y)
Parameters
Type |
Name |
Description |
int |
x |
|
int |
y |
|
Returns
add(Vector2i v)
Declaration
public Vector2i add(Vector2i v)
Parameters
Returns
equals(int x, int y)
Declaration
public boolean equals(int x, int y)
Parameters
Type |
Name |
Description |
int |
x |
|
int |
y |
|
Returns
equals(Object obj)
Declaration
public boolean equals(Object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
length()
Declaration
Returns
length(int x, int y)
Declaration
public static double length(int x, int y)
Parameters
Type |
Name |
Description |
int |
x |
|
int |
y |
|
Returns
lengthSquared()
Declaration
public long lengthSquared()
Returns
lengthSquared(int x, int y)
Declaration
public static long lengthSquared(int x, int y)
Parameters
Type |
Name |
Description |
int |
x |
|
int |
y |
|
Returns
max(Vector2i v)
Declaration
public Vector2i max(Vector2i v)
Parameters
Returns
maxComponent()
Declaration
public int maxComponent()
Returns
min(Vector2i v)
Declaration
public Vector2i min(Vector2i v)
Parameters
Returns
minComponent()
Declaration
public int minComponent()
Returns
mul(int scalar)
Declaration
public Vector2i mul(int scalar)
Parameters
Type |
Name |
Description |
int |
scalar |
|
Returns
mul(Vector2i v)
Declaration
public Vector2i mul(Vector2i v)
Parameters
Returns
negate()
Declaration
Returns
Type |
Description |
Vector2i |
a vector holding the result
|
negate(Vector2i dest)
Declaration
public Vector2i negate(Vector2i dest)
Parameters
Returns
set(int s)
Set the x and y components to the supplied value.
Declaration
public Vector2i set(int s)
Parameters
Type |
Name |
Description |
int |
s |
scalar value of both components
|
Returns
set(int x, int y)
Declaration
public Vector2i set(int x, int y)
Parameters
Type |
Name |
Description |
int |
x |
|
int |
y |
|
Returns
set(Vector2i v)
Declaration
public Vector2i set(Vector2i v)
Parameters
Returns
setX(int x)
Declaration
Parameters
Type |
Name |
Description |
int |
x |
|
setY(int y)
Declaration
Parameters
Type |
Name |
Description |
int |
y |
|
sub(int x, int y)
Declaration
public Vector2i sub(int x, int y)
Parameters
Type |
Name |
Description |
int |
x |
|
int |
y |
|
Returns
toString()
Declaration
Returns
x()
Declaration
Returns
y()
Declaration
Returns
zero()
Set all components to zero.
Declaration
Returns
Type |
Description |
Vector2i |
a vector holding the result
|