<commit_before>//<NAME>
//A base example of using vectors for motion
var m; //the mover

function setup(){
  createCanvas(400,400);
  background(50);
  m = new mover();

}

function draw(){
background(50);
gravity = createVector(0,0.1);
m.force(gravity);
m.update();
m.bounceEdges();

m.display();
m.acceleration.mult(0);//reset acceleration each frame
}


function mover(){
this.location = createVector(random(width),random(height));
this.velocity = createVector(0,0); //initial
this.acceleration = createVector(0.2,0);
//this.velocity = createVector(random(-4,4),random(-4,4)); //initial velocity
this.r = 20; //radius

this.update = function(){
  this.velocity.add(this.acceleration);
  this.location.add(this.velocity);
}

this.force = function(f){
this.acceleration.add(f);<commit_msg>updated mover class to accept initial variables<commit_after>//<NAME>
//A base example of using vectors for motion
var m = []; //the mover

function setup(){
  createCanvas(400,400);
  background(50);
  for (var i=0;i<10;i++){
      m[i] = new mover(random(width),random(height),random(5,40));
  }


}

function draw(){
background(50);
for (var i=0;i<10;i++){

gravity = createVector(0,0.1);
m[i].force(gravity);
wind = createVector(0.02,0);
m[i].force(wind);

m[i].bounceEdges();
m[i].update();
m[i].display();
}
}


function mover(x,y,r){
this.location = createVector(x,y);
this.velocity = createVector(0,0); //initial
this.acceleration = createVector(0,0);
//this.velocity = createVector(random(-4,4),random(-4,4)); //initial velocity
this.r = r; //radius
this.mass = sqrt(r);

this.update = function(){
  this.velocity.add(this.acceleration);
  this.location.add(this.velocity);
  this.acceleration.mult(0);//reset acceleration each frame
}

this.force = function(force){
f= force.copy();
f = f.div(this.mass);
this.acceleration.add(f);
{'fraction_non_alphanumeric': 0.1918032786885246, 'fraction_numerical': 0.03278688524590164, 'mean_word_length': 5.144295302013423, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7522408', 'n_tokens_mistral': 700, 'n_tokens_neox': 647, 'n_words': 132}