function normalize(A) {
  let v0 = math.column(A, 0);
  let v1 = math.column(A, 1);
  let v2 = math.column(A, 2);

  // Normalize the first vector
  let w0 = mt(1 / sqrt(dot(v0, v0)), v0);

  // Make v1 perpendicular to v0
  let u1 = sub(v1, mt(w0, dot(v1, w0)));

  // Normalize v1
  let w1 = mt(1 / sqrt(dot(u1, u1)), u1);

  // Make v2 perpendicular to
  let u2 = sub(sub(v2, mt(w0, dot(v2, w0))), mt(w1, dot(v2, w1)));

  // Normalize v2
  let w2 = mt(1 / sqrt(dot(u2, u2)), u2);

  return math.concat(w0, w1, w2);
}
// Normalize a matrix, using Gram Schmidt
Normalize a matrix, using Gram Schmidt
Normalize a matrix using Gram Schmidt
function normalize(A) {
  let v0 = math.column(A, 0);
  let v1 = math.column(A, 1);
  let v2 = math.column(A, 2);
  let w0 = mt(1 / sqrt(dot(v0, v0)), v0);
  let u1 = sub(v1, mt(w0, dot(v1, w0)));
  let w1 = mt(1 / sqrt(dot(u1, u1)), u1);
  let u2 = sub(sub(v2, mt(w0, dot(v2, w0))), mt(w1, dot(v2, w1)));
  let w2 = mt(1 / sqrt(dot(u2, u2)), u2);
  return math.concat(w0, w1, w2);
}
function normalize ( A ) { let v0 = math . column ( A , 0 ) ; let v1 = math . column ( A , 1 ) ; let v2 = math . column ( A , 2 ) ; let w0 = mt ( 1 / sqrt ( dot ( v0 , v0 ) ) , v0 ) ; let u1 = sub ( v1 , mt ( w0 , dot ( v1 , w0 ) ) ) ; let w1 = mt ( 1 / sqrt ( dot ( u1 , u1 ) ) , u1 ) ; let u2 = sub ( sub ( v2 , mt ( w0 , dot ( v2 , w0 ) ) ) , mt ( w1 , dot ( v2 , w1 ) ) ) ; let w2 = mt ( 1 / sqrt ( dot ( u2 , u2 ) ) , u2 ) ; return math . concat ( w0 , w1 , w2 ) ; }
Normalize a matrix, using Gram Schmidt
Normalize a matrix using Gram Schmidt
// Normalize the first vector // Make v1 perpendicular to v0 // Normalize v1 // Make v2 perpendicular to // Normalize v2