Skip to main content
  • Reference
  • Tutorials
  • Examples
  • Contribute
  • Community
  • About
  • Start Coding
  • Donate
Reference x

x

The x component of the vector

Notice any errors or typos? Please let us know. Please feel free to edit src/math/p5.Vector.js and open a pull request!

Related References

    add

    Adds to a vector's x, y, and z components.

    angleBetween

    Calculates the angle between two vectors.

    array

    Returns the vector's components as an array of numbers.

    clampToZero

    Replaces the components of a p5.Vector that are very close to zero with zero.

p5.js
Resources
  • Reference
  • Tutorials
  • Examples
  • Contribute
  • Community
  • About
  • Start Coding
  • Donate
Information
  • Download
  • Contact
  • Copyright
  • Privacy Policy
  • Terms of Use
Socials
  • GitHub
  • Instagram
  • X
  • YouTube
  • Discord
  • Forum

Looking for the old p5.js site? Find it here!