fromArray method

SphericalHarmonics3 fromArray(
  1. List<double> array, [
  2. int offset = 0
])

array - The array holding the numbers of the SH coefficients.

offset - (optional) The array offset.

Sets the coefficients of this instance from the given array.

Implementation

SphericalHarmonics3 fromArray(List<double> array, [int offset = 0]) {
  final coefficients = this.coefficients;

  for (int i = 0; i < 9; i++) {
    coefficients[i].copyFromArray(array, offset + (i * 3));
  }

  return this;
}