CGSGDimension Class
A Dimension object
Item Index
Methods
- add
- addEquals
- copy
- cross
- divide
- divideByFloat
- divideByFloatEquals
- divideEquals
- dot
- getDistance
- getLength
- getSquaredLength
- isEmpty
- multiply
- multiplyByFloat
- multiplyByFloatEquals
- multiplyEquals
- normalize
- perp
- perpendicular
- project
- resizeBy
- resizeTo
- resizeWith
- rotate
- sign
- subtract
- subtractEquals
- toString
- unit
- unitEquals
- unitFast
Methods
add
-
vector
returns a new vector added to the value passed in parameter
Parameters:
-
vector
CGSGVector2D
addEquals
-
vector
add to this vector, the value passed in parameter
Parameters:
-
vector
CGSGVector2D
cross
()
public
Get cross product of this vector and another vector
divide
-
vector
return a new vector divided by the value passed in parameter
Parameters:
-
vector
CGSGVector2D
divideEquals
-
vector
divide to this vector, the value passed in parameter
Parameters:
-
vector
CGSGVector2D
dot
()
public
Get dot product of this vector and another vector
getDistance
-
vector
Compute the euclidian distance between this vector and the one passe in parameter
Parameters:
-
vector
CGSGVector2D
Returns:
multiply
-
vector
returns a new vector multiplied to the value passed in parameter
Parameters:
-
vector
CGSGVector2D
multiplyEquals
-
vector
multiply to this vector, the value passed in parameter
Parameters:
-
vector
CGSGVector2D
normalize
()
public
Normalize this vector
perp
()
public
Get a perpendicular vector of this vector
perpendicular
()
public
Get a vector perpendicular to this vector and another vector
project
()
public
Get a projected vector of this vector and another vector
resizeBy
-
widthFactor
-
heightFactor
Multiply current dimension by these new ones
resizeTo
-
newWidth
-
newHeight
Replace current dimension by these new ones
resizeWith
-
width
-
height
Increase/decrease current dimension with adding values
sign
()
public
Determines if a given vector is to the right or left of this vector.
subtract
-
vector
returns a new vector subtracted from the value passed in parameter
Parameters:
-
vector
CGSGVector2D
subtractEquals
-
vector
subtract to this vector, the value passed in parameter
Parameters:
-
vector
CGSGVector2D
toString
()
public
Get a string representing this vector
unit
()
public
Get unit vector of this vector and another vector
unitEquals
()
public
Get unit vector of this vector and another vector
unitFast
()
public
Get approximation of unit vector of this vector and another vector