TraerAttraction:
Filter:
TraerPhysics/Classes (extension) | TraerPhysics

TraerAttraction
ExtensionExtension

act on two particles

Description

Attractions or repulsions (negative attraction) act on 2 particles and either constantly pull them together or constantly pull them apart by applying a force to each particle:

G*m1*m2/d2

in other words the force is is much stronger close up than far away.

Attractions/repulsions have 2 properties:

  1. Strength - the G up there.
  2. Minimum Distance - the force does not get stronger closer than this
NOTE: Documentation is only very slightly adapted to comply with the SuperCollider port. See the original by Jeffrey Traer Bernstein here... http://murderandcreate.com/physics/

Instance Methods

.getStrength

Positive strength is attraction, negative strength is repulsion.

Returns:

.setStrength

Positive strength is attraction, negative strength is repulsion.

Arguments:

k

a Float

.getOneEnd

.getTheOtherEnd

Return the particles being attracting or repelling each other.

Returns:

.getMinimumDistance

Get the minimum distance, which limits how strong the force can get close up.

Returns:

.setMinimumDistance

Set the minimum distance, which limits how strong the force can get close up.

Arguments:

d

a Float