Name

heading()

Class

PVector

Description

Calculate the angle of rotation for this vector (only 2D vectors)

Examples

  • PVector v;
    
    void setup() {
      v = new PVector(10.0, 20.0);
      println(v.heading());  // Prints "1.1071488"
    }
    

Syntax

  • .heading()

Return

  • float