다수의 힘이 물체에 작용하는 시뮬레이션입니다. 물체에는 지속적으로 중력이 적용됩니다. 물체가 “물”에 있을 때는 유체 저항이 작용합니다. (natureofcode.com)
힘 계산은 p5.Vector 클래스를 사용되며 수행되며, 이는 벡터를 생성하기 위한 createVector() 함수를 포함합니다.
힘 by p5.js Contributors and the Processing Foundation is licensed under CC BY-NC-SA 4.0.
관련 예제
![](/_astro/15_Math_And_Physics-00_Non_Orthogonal_Reflection-thumbnail.DeYbXLbr_Z2sprbi.webp)
No alt text
비직각 반사
경사진 표면에서 튕기는 공을 시뮬레이션합니다.
![](/_astro/15_Math_And_Physics-01_Soft_Body-thumbnail.CaUlsLEf_Z2t2M4j.webp)
No alt text
소프트 바디(Soft Body)
마우스 방향으로 가속되는 부드러운 물체의 물리학을 시뮬레이션합니다.
![](/_astro/15_Math_And_Physics-02_Forces-thumbnail.76GklzEL_HHQbe.webp)
No alt text
힘
여러 물체가 유체를 통과하면서 작용하는 힘을 시뮬레이션합니다.
![](/_astro/15_Math_And_Physics-03_Smoke_Particle_System-thumbnail.DKQ430DH_2kCjh8.webp)
No alt text
연기 입자(Smoke Particles)
입자 시스템(particle system)을 활용하여 연기를 시뮬레이션합니다.
![](/_astro/15_Math_And_Physics-04_Game_Of_Life-thumbnail.5UrIGGfY_1qP5lX.webp)
No alt text
라이프 게임(Game of Life)
존 콘웨이(John Conway)의 세포 자동자(cellular automation)를 재현합니다.
![](/_astro/15_Math_And_Physics-05_Mandelbrot-thumbnail.DrMp2tOi_Z2016jT.webp)
No alt text
망델브로 집합(Mandelbrot Set)
프랙탈 구조를 생성하는 수학적인 집합을 시각화합니다.