Update vector docs: Add vector.combine

This commit is contained in:
Lars Müller 2022-08-28 10:32:17 +02:00 committed by GitHub
parent f4743c97cb
commit 70324a4512
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -91,6 +91,15 @@ Equivalent to `vector.apply(v, math.round)`
Returns a new `vector` where each component of `v` has had `func` applied to it.
=== `vector.combine(v, w, func) -> vector`
* `v`: `vector`
* `w`: `vector`
* `func`: `function`
Returns a new `vector` where each pair of respective components of `v` and `w` has had `func` applied to it.
Example: `vector.combine(v, w, math.pow)` is the same as `vector.new(math.pow(v.x, w.x), math.pow(v.y, w.y), math.pow(v.z, w.z))`.
=== `vector.distance(a, b) -> number`
* `a`, `b`: `vector`