v3Normalize static method

List<double> v3Normalize(
  1. List<double> vector,
  2. double norm
)

Implementation

static List<double> v3Normalize(List<double> vector, double norm) {
  var im = 1 / (_isZero(norm) ? v3Length(vector) : norm);
  return [vector[0] * im, vector[1] * im, vector[2] * im];
}