Skip to content

Commit d915ca1

Browse files
committedMar 19, 2016
lua_api.txt: improve vector documentation
Before it rendered very badly in HTML. Also point out what vector.round does.
1 parent 3132bcb commit d915ca1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed
 

Diff for: ‎doc/lua_api.txt

+6-7
Original file line numberDiff line numberDiff line change
@@ -1688,16 +1688,15 @@ or string form, a ColorString (defined above):
16881688
`colorspec = "green"`
16891689

16901690
Spatial Vectors
1691-
--------------
1692-
1693-
* `vector.new([x[, y, z]])`: returns a vector.
1694-
* `x` is a table or the `x` position.
1695-
1691+
---------------
1692+
* `vector.new(a[, b, c])`: returns a vector:
1693+
* A copy of `a` if `a` is a vector.
1694+
* `{x = a, y = b, z = c}`, if all `a, b, c` are defined
16961695
* `vector.direction(p1, p2)`: returns a vector
16971696
* `vector.distance(p1, p2)`: returns a number
16981697
* `vector.length(v)`: returns a number
16991698
* `vector.normalize(v)`: returns a vector
1700-
* `vector.round(v)`: returns a vector
1699+
* `vector.round(v)`: returns a vector, each dimension rounded to floor
17011700
* `vector.apply(v, func)`: returns a vector
17021701
* `vector.equals(v1, v2)`: returns a boolean
17031702

@@ -1709,7 +1708,7 @@ For the following functions `x` can be either a vector or a number:
17091708
* `vector.divide(v, x)`: returns a scaled vector or Schur quotient
17101709

17111710
Helper functions
1712-
-----------------
1711+
----------------
17131712
* `dump2(obj, name="_", dumped={})`
17141713
* Return object serialized as a string, handles reference loops
17151714
* `dump(obj, dumped={})`

0 commit comments

Comments
 (0)