mirror of
https://github.com/minetest/minetest_docs.git
synced 2024-07-07 08:35:16 +02:00
Update vector docs: Add vector.combine
This commit is contained in:
parent
f4743c97cb
commit
70324a4512
@ -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.
|
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`
|
=== `vector.distance(a, b) -> number`
|
||||||
* `a`, `b`: `vector`
|
* `a`, `b`: `vector`
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user