Vector2¶
Fields¶
Name | Type | Ranges |
---|---|---|
x | float | X coordinates |
y | float | Y coordinates |
Functions¶
Vector2()¶
Return value¶
Name | Type | Description |
---|---|---|
vector | Vector2 | Returns a Vector2 ( 0, 0 ) |
Example
1 2 3 |
|
Vector2()¶
Parameters¶
Parameter | Type | Description |
---|---|---|
x | float | X coordinates |
y | float | Y coordinates |
Return value¶
Name | Type | Description |
---|---|---|
vector | Vector2 | Returns a Vector2 ( x, y ) |
Example
1 2 3 |
|
IsValid()¶
Return value¶
Name | Type | Description |
---|---|---|
valid | bool | Returns true if the vector is valid, it's components aren't infinite values |
Example
1 2 3 4 |
|
DistanceTo()¶
Parameters¶
Parameter | Type | Description |
---|---|---|
vector | Vector2 | The other vector |
Return value¶
Name | Type | Description |
---|---|---|
distance | float | Returns the distance to the second vector |
Example
1 2 3 |
|
Lenght()¶
Return value¶
Name | Type | Description |
---|---|---|
lenght | float | Returns the lenght of the vector |
Example
1 2 |
|
DotProduct()¶
Parameters¶
Parameter | Type | Description |
---|---|---|
vector | Vector2 | The other vector |
Return value¶
Name | Type | Description |
---|---|---|
lenght | float | Returns the dot product |
Example
1 2 3 |
|
CrossProduct()¶
Parameters¶
Parameter | Type | Description |
---|---|---|
vector | Vector2 | The other vector |
Return value¶
Name | Type | Description |
---|---|---|
vector | Vector2 | Returns the cross product |
Example
1 2 3 4 5 |
|