Name

setHeading()

Class

PVector

Description

Sets the angle this vector makes with the positive X axis (only 2D vectors) This is equivalent to changing the vector's direction to the given value.

Syntax

  • myPVector.setHeading(angle)

Parameters

  • myPVector(PVector)your PVector object
  • angle(float)the direction of the resultant vector

Return

  • PVector