Difference between revisions of "Vector.new"
From ComputerCraft Wiki
(Created page with "Returns a table with the labels "x", "y" and "z" containing the coordinates of the vector. local a = vector.new(1, 2, 3) save(a, "vector") print(a.x) print(a.y) print(...") |
(Changing int to number) |
||
(6 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{lowercase}} | |
− | + | {{Function | |
− | + | |name=vector.new | |
+ | |args={{type|number}} x, {{type|number}} y, {{type|number}} z | ||
+ | |returns=[[vector (API)|vector]] | ||
+ | |api=vector | ||
+ | |addon=ComputerCraft | ||
+ | |desc=Creates a vector. | ||
+ | |examples= | ||
+ | {{Example | ||
+ | |desc=Creates a vector and prints the components | ||
+ | |code= local a = vector.new(1, 2, 3) | ||
− | |||
print(a.x) | print(a.x) | ||
print(a.y) | print(a.y) | ||
print(a.z) | print(a.z) | ||
− | + | --1 | |
− | + | --2 | |
− | + | --3 | |
+ | }} | ||
+ | }} | ||
+ | |||
+ | [[Category:API_Functions]] |
Latest revision as of 13:10, 18 July 2013
Function vector.new | |
Creates a vector. | |
Syntax | vector.new(number x, number y, number z) |
Returns | vector |
Part of | ComputerCraft |
API | vector |
Examples
Example | |
Creates a vector and prints the components | |
Code |
local a = vector.new(1, 2, 3) print(a.x) print(a.y) print(a.z) --1 --2 --3 |