実例

複数の力が物体に作用するデモンストレーション。 物体は重力を常に受けます。物体は「水」の中にいるときに流体抵抗を受けます。 (natureofcode.com)

力の計算は p5.Vector クラスを使用して行われ、ベクトルを作成するための createVector() 関数が含まれています。

Creative Commons BY-NC-SA license badge

: 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!