Show:

CGSGVector2D Class

A 2D vector object

Methods

add
(
  • vector
)
public

add to this vector, the value passed in parameter

Parameters:
copy () CGSGVector2D public
Returns:
CGSGVector2D: a new CGSGVector2D, clone of this one
divide
(
  • vector
)
public

divide to this vector, the value passed in parameter

Parameters:
divideByFloat
(
  • f
)
public

Divide x and y by f

Parameters:
getDistance
(
  • vector
)
Number public

Compute the euclidian distance between this vector and the one passe in parameter

Parameters:
Returns:
getLength () Number public
Returns:
getSquaredLength () Number public
Returns:
multiply
(
  • vector
)
public

multiply to this vector, the value passed in parameter

Parameters:
multiplyByFloat
(
  • f
)
public

Multiply x and y by f

Parameters:
normalize () public

Normalize this vector

rotate
(
  • angle
)
public

rotate this vector around its origin

Parameters:
substract
(
  • vector
)
public

substract to this vector, the value passed in parameter

Parameters: