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: