Simon translated Attraction and Repulsion Forces Coding Challenge into Java

Simon translated part of the Attraction and Repulsion Forces Coding Challenge from JavaScript into Processing (Java). In the first video below he explains the formulas for attraction and repulsion forces:

This is the part that Simon successfully translated into Java:

 

 

 

Around minute 30 of the Attraction and Repulsion Forces Coding Challenge video Simon got stuck with his Java code. Although everything seemed right, his particle didn’t trace nice patterns but went off the screen. Simon was very upset about this, it took me a while to console him. This is where Simon got stuck:

Advertisements Share this:
Like this:Like Loading... Related