function vnorm(v,length) {
  var x=v[0];
  var y=v[1];
  var angle=Math.atan2(x,y);
  if(!length)
    length=1;
  return([
    sin(angle)*length,
    cos(angle)*length
  ]);
}
/**
 ** Normalize a 2D vector
 ** eg scaling elements such that net length is 1
 ** Turns vector 'v' into a 'unit vector'
 */
Normalize a 2D vector
eg scaling elements such that net length is 1
Turns vector 'v' into a 'unit vector'
Normalize a 2D vector eg scaling elements such that net length is 1 Turns vector ' v ' into a ' unit vector '
function vnorm(v,length) {
  var x=v[0];
  var y=v[1];
  var angle=Math.atan2(x,y);
  if(!length)
    length=1;
  return([
    sin(angle)*length,
    cos(angle)*length
  ]);
}
function vnorm ( v , length ) { var x = v [ 0 ] ; var y = v [ 1 ] ; var angle = Math . atan2 ( x , y ) ; if ( ! length ) length = 1 ; return ( [ sin ( angle ) * length , cos ( angle ) * length ] ) ; }
Normalize a 2D vector
 eg scaling elements such that net length is 1
 Turns vector 'v' into a 'unit vector'
Normalize a 2D vector eg scaling elements such that net length is 1 Turns vector ' v ' into a ' unit vector '