int num = 60; 
float mx[] = new float[num]; 
float my[] = new float[num]; 
 
void setup() { 
  size(300, 300); 
  framerate(30);
} 
 
void draw() { 
  background(0);
  
  for(int i=1; i<num; i++) { 
    mx[i-1] = mx[i]; 
    my[i-1] = my[i]; 
  } 

  mx[num-1] = mouseX; 
  my[num-1] = mouseY; 
  
  stroke(255);

   
  for(int i=1; i<num; i++) {
    
    float angle1 = atan2(my[i]-height/2, mx[i]-width/2);
    float dist1 = dist(mx[i], my[i], width/2, height/2);
    float add1 = (num-i)+sq(num-i)*0.05;
    float add2 = (num-i)+sq(num-i)*0.2;
  
    line(width/2 + cos(angle1)*(dist1 + add1), height/2 + sin(angle1)*(dist1 + add1),
         width/2 + cos(angle1)*(dist1 + add2), height/2 + sin(angle1)*(dist1 + add2));
  }
  
  beginShape(LINE_STRIP); 
  for(int i=1; i<num; i++) {

    float angle1 = atan2(my[i]-height/2, mx[i]-width/2);
    float dist1 = dist(mx[i], my[i], width/2, height/2);
    float add1 = (num-i)+sq(num-i)*0.05;
    
    vertex(width/2 + cos(angle1)*(dist1 + add1), height/2 + sin(angle1)*(dist1 + add1));
  }
  endShape();
  
  beginShape(LINE_STRIP); 
  for(int i=1; i<num; i++) {  

    float angle1 = atan2(my[i]-height/2, mx[i]-width/2);
    float dist1 = dist(mx[i], my[i], width/2, height/2);
    float add1 = (num-i)+sq(num-i)*0.1;
    
    vertex(width/2 + cos(angle1)*(dist1 + add1), height/2 + sin(angle1)*(dist1 + add1));
  }
  endShape();
  
  beginShape(LINE_STRIP); 
  for(int i=1; i<num; i++) {
  
    float angle1 = atan2(my[i]-height/2, mx[i]-width/2);
    float dist1 = dist(mx[i], my[i], width/2, height/2);
    float add1 = (num-i)+sq(num-i)*0.2;
    
    vertex(width/2 + cos(angle1)*(dist1 + add1), height/2 + sin(angle1)*(dist1 + add1));
  }
  endShape();
}
Exercise 3.C: Gesture
Write a program which records data from the mouse into an array and converts this data into visual form. Either record and display the data continuously or build a structure for separate recording and playback modes.