globals.js
var g_ctx;
var g_side=0;
var g_step;
var g_x, g_y, g_h;
more for my.js
function cs() {
  g_ctx.clearRect(0,0,g_side,g_side);
}
function home() {
  g_x=g_side/2; g_y=g_side/2; g_h=0;
}
function vmin() {
  var w=innerWidth; var h=innerHeight;
  var v=w;
  if (h<w) v=h;
  return v/100;
}

Note that home is in the centre of the canvas.