Method | Description |
Int2 new(int x, int y) | Static constructor |
Int2 clone() | Duplicate this object |
int x([int new_x]) | Set or get the X coordinate |
int y([int new_y]) | Set or get the Y coordinate |
int width() | Alias of x() (makes more sense when the value represents a size instead of a position). |
int height() | Alias of y() (makes more sense when the value represents a size instead of a position). |
number norm() | Get the norm of the (x,y) vector. |
string str() | Get a string showing the Int2 values with the syntax "(x,y)". |
number distanceTo(Int2 other_point) | Get the distance between this position and another position. In other words, compute √((x1-x2)²+(y1-y2)²) |
number dotProduct(Int2 other_point) | Get the scalar product between this vector and another vector. |
bool equals(Int2 other_point) | Return true if the coordinates are the same. |
This data type has also overloaded "+" and "-" operators.
Method | Description |
Int3 new(int x, int y, int z) | Static constructor |
Int3 clone() | Duplicate this object |
int x([int new_x]) | Set or get the X coordinate |
int y([int new_y]) | Set or get the Y coordinate |
int z([int new_z]) | Set or get the Z coordinate |
number distanceTo(Int3 other_point) | Get the distance between this position and another position. In other words, compute √((x1-x2)²+(y1-y2)²+(z1-z2)²) |
bool equals(Int3 other_point) | Return true if the coordinates are the same. |
This data type has also overloaded "+" and "-" operators.
Method | Description |
Number3 new(number x, number y, number z) | Static constructor |
Number3 clone() | Duplicate this object |
number x([number new_x]) | Set or get the X coordinate |
number y([number new_y]) | Set or get the Y coordinate |
number z([number new_z]) | Set or get the Z coordinate |
number distanceTo(Number3 other_point) | Get the distance between this position and another position. In other words, compute √((x1-x2)²+(y1-y2)²+(z1-z2)²) |
Number3 normalized() | Get a normalized version of this vector |
bool equals(Number3 other_point) | Return true if the coordinates are the same. |
This data type has also overloaded "+" and "-" operators.