> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://bard117s14.sketchpad.cc/sp/pad/view/ro.NXxPHqakebg/rev.70
 * 
 * authors: 
 *   Daniel
 *   Sarah D.
 *   Milo Ben-Amotz
 *   Lucas Baumgart
 *   Paula Van Erven
 *   Laura Salgarolo
 *   Christopher Shea
 *   Lauren Harris
 *   josh abramovici
 *   Sam Robotham
 *   Keith O'Hara
 *   keith mackie

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



// Keith O'Hara <[email protected]>
// Feb 22 2014
// CMSC 117

float x = 0;
float y = 0;

void setup()
{ 
  size(500, 500);
  strokeWeight(2);
  smooth();
}
//speed
float sign(float a)
{
  if (a < 0) {
    return -1;
  }
  else if (a > 0){
    return 1;
  }
  else{
    return 0;
  }
}

float ease(float pos, float goal)
{
  return pos +.05 * (goal - pos);
}

float steady(float pos, float goal)
{
  return pos + 2*sign(goal - pos);
}

void draw()
{
  background(24);
  x = steady(x, mouseX);
  y = steady(y, mouseY);
  ellipse(x, y, 15, 15);
}