Move the cursor over the image to draw with a software tool which responds to the speed of the mouse.

void setup() {
  size(640, 360);

void draw() {
  // Call the variableEllipse() method and send it the
  // parameters for the current mouse position
  // and the previous mouse position
  variableEllipse(mouseX, mouseY, pmouseX, pmouseY);

// The simple method variableEllipse() was created specifically 
// for this program. It calculates the speed of the mouse
// and draws a small ellipse if the mouse is moving slowly
// and draws a large ellipse if the mouse is moving quickly 

void variableEllipse(int x, int y, int px, int py) {
  float speed = abs(x-px) + abs(y-py);
  ellipse(x, y, speed, speed);

Functions Used


Calculates the absolute value (magnitude) of a number

Learn More

Sets the color used to draw lines and borders around shapes

Learn More

Defines the dimension of the display window width and height in units of pixels

Learn More

Draws an ellipse (oval) to the screen

Learn More

The setup() function is run once, when the program starts

Learn More

Called directly after setup(), the draw() function continuously executes the lines of code contained inside its block until the program is stopped or noLoop() is called

Learn More

The background() function sets the color used for the background of the Processing window

Learn More