sub3 static method

PVector? sub3(
  1. PVector v1,
  2. PVector v2,
  3. PVector? target
)

Subtract one vector from another and store in another vector @param target PVector in which to store the result

Implementation

static PVector? sub3(PVector v1, PVector v2, PVector? target) {
  if (target == null) {
    target = new PVector(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
  } else {
    target.set(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
  }
  return target;
}