API Reference › Vector › Vector.sub
method

Vector.sub

Vector.sub(a, b) -> Vector

Returns the component-wise difference a - b — the vector that points from b to a. Pair it with Vector.length or Vector.normalize to get a distance or a direction.

Example

program Demo {
  handler Step phase Update {
    let toTarget = Vector.sub(target, pos)
  }
}
← All symbols