Class: Particle

Particle(radius, pos, charge)

Class representing a particle

Constructor

new Particle(radius, pos, charge)

Create a Particle.
Parameters:
Name Type Description
radius number The radius of the particle.
pos p5.Vector The position vector of the particle.
charge number The electric charge of the particle.
Source:

Methods

draw()

Draws the particle on the screen. The fill of the particle changes depending on the charge of the particle. Red is positive blue is negative.
Source:

Documentation generated by JSDoc 4.0.2 on Sun Jan 26 2025 19:14:19 GMT-0800 (Pacific Standard Time)