Ex_01_04_PVector_mult

vectorA.mult(value)

void setup(){
  size(600,600);
}

void draw(){
  background(255);
  
  PVector mouse = new PVector(mouseX,mouseY);
  PVector center = new PVector(width/2,height/2);
  
  mouse.sub(center);
  
  mouse.mult(0.5);
  
  translate(width/2,height/2);
  
  stroke(0);
  line(0,0,mouse.x,mouse.y);
  
  noStroke();
  
  fill(255,0,0);
  ellipse(mouse.x,mouse.y,8,8);
 
  fill(0,0,255);
  ellipse(mouseX - width/2,mouseY - height/2,8,8);
}