Skip to content

EmilSoleymani/Pendulum.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pendulum Simulation

Pendulum Simulation created using the p5.js library. For more information on p5.js, see here.

This software simulates simple pendulums, with a basic collision system.

How to use

To use the Pendulum class, simply create new Pendulum instances and store them in an array called pendulums. In the draw() loop enter the following code to update and render pendulums:

for(let p of pendulums){
    p.update()
    p.render()
    p.collides()
}

Pendulum class requires the following arguments:

new Pendulum(x, y, length, mass, initial_angle)

Improvements

Will be working on adding interactivity, better collisions

About

Simple pendulum simulation using Javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published