new Vector(pX, pY)
Vector object.
Parameters:
Name | Type | Description |
---|---|---|
pX |
int | X position. |
pY |
int | Y position. |
Members
-
x :int
-
x position.
Type:
- int
-
y :int
-
y position.
Type:
- int
Methods
-
add(vector) → {FM.Vector}
-
Add the specified vector to the current one;
Parameters:
Name Type Description vector
FM.Vector The vector to add. Returns:
The vector modified.- Type
- FM.Vector
-
clone() → {FM.Vector}
-
Clone the current vector.
Returns:
The new cloned vector.- Type
- FM.Vector
-
copy(vector) → {FM.Vector}
-
Copy the given vector to the current one.
Parameters:
Name Type Description vector
FM.Vector The vector to copy. Returns:
The vector copied.- Type
- FM.Vector
-
crossProd(vector) → {float}
-
Calculate the cross product of the current vector and another vector.
Parameters:
Name Type Description vector
FM.Vector The vector to cross product. Returns:
The cross product.- Type
- float
-
destroy()
-
Destroy the point and its objects.
-
dotProduct(vector) → {FM.Vector}
-
Dot operation on the current vector and the specified one;
Parameters:
Name Type Description vector
FM.Vector The vector to dot product. Returns:
The dot product.- Type
- FM.Vector
-
getLength() → {float}
-
Return length of the vector;
Returns:
The length of the vector.- Type
- float
-
getLengthSquared() → {int}
-
Return length of the vector;
Returns:
The squared length of the vector.- Type
- int
-
isEquals(vector) → {boolean}
-
Check if the current vector is equals to the specified one;
Parameters:
Name Type Description vector
FM.Vector The vector to compare. Returns:
Whether the two vector are equal or not.- Type
- boolean
-
multiply(vector) → {FM.Vector}
-
Multiply the current vector by the one specified;
Parameters:
Name Type Description vector
FM.Vector The vector to multiply. Returns:
The vector modified.- Type
- FM.Vector
-
normalize()
-
Normalize the vector.
-
reset(pX, pY) → {FM.Vector}
-
Reset the vector the specified values.
Parameters:
Name Type Description pX
int The x position. pY
int The y position. Returns:
The vector reset.- Type
- FM.Vector
-
substract(vector) → {FM.Vector}
-
Substract the specified vector from the current one;
Parameters:
Name Type Description vector
FM.Vector The vector to substract. Returns:
The vector modified.- Type
- FM.Vector