Skip to main content Link Menu Expand (external link) Document Search Copy Copied

PVector(double x, double y)

This constructor creates a new PVector with the given x and y values. The z value is set to 0.0. There really isn’t very much to say about this constructor, it just sets x and y to the parameters.

Parameters

  • x - The x value of the vector
  • y - The y value of the vector

Example

PVector v = PVector(1.0, 2.0);
/*
v.x == 1.0
v.y == 2.0
v.z == 0.0
*/

See Also