Vector3.fromArray constructor

Vector3.fromArray(
  1. Array v
)

Implementation

factory Vector3.fromArray(Array v) {
  assert(v.shape.item1 == 3 && v.shape.item2 == 1);
  var x = v.getValue(Tuple2(0, 0));
  var y = v.getValue(Tuple2(1, 0));
  var z = v.getValue(Tuple2(2, 0));
  return Vector3(x, y, z);
}