多种力作用于物体时的演示。 物体持续受到重力影响。当在“水”中时,物体会经历流体阻力。 (natureofcode.com)
使用 p5.Vector 类进行力的计算,包括使用 createVector() 函数创建向量。
力: Inspired by Dan Shiffman's "Nature of Code". Revised by Darren Kessner. From 2024 onwards, edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.
You can find the code history of these examples here: 2023 code. You can suggest improvements by contributing to the current website!