From 70324a4512fff6f5ea0a6e3bdf2a78eb16591826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Sun, 28 Aug 2022 10:32:17 +0200 Subject: [PATCH] Update vector docs: Add vector.combine --- doc/classes/vector.adoc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/classes/vector.adoc b/doc/classes/vector.adoc index 3ce471d..9bea664 100644 --- a/doc/classes/vector.adoc +++ b/doc/classes/vector.adoc @@ -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`