static transform3D(input, matrix, result) {
    //>>includeStart('debug', pragmas.debug);
    Check.defined("input", input);
    Check.defined("matrix", matrix);
    //>>includeEnd('debug');

    if (!defined(result)) {
      result = new Float32Array(input.length);
    }
    const c = new Cartesian3();
    const elementCount = input.length / 3;
    for (let i = 0; i < elementCount; i++) {
      Cartesian3.unpack(input, i * 3, c);
      Matrix4.multiplyByPoint(matrix, c, c);
      Cartesian3.pack(c, result, i * 3);
    }
    return result;
  }
Transform the elements of the given array with the given 4x4 matrix,
interpreting each 3 consecutive elements as a 3D point, and write
the result into the given result array, creating the result array
if it was undefined.

@param {TypedArray} input The input array
@param {Matrix4} matrix The matrix
@param {TypedArray} [result] The result
@returns {TypedArray} The result