Difference between revisions of "Vector.new"

From ComputerCraft Wiki
Jump to: navigation, search
(Changing int to number)
 
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=vector.new
 
|name=vector.new
|args=[[float (type)|float]] x, [[float (type)|float]] y, [[float (type)|float]] z
+
|args={{type|number}} x, {{type|number}} y, {{type|number}} z
 
|returns=[[vector (API)|vector]]
 
|returns=[[vector (API)|vector]]
 
|api=vector
 
|api=vector

Latest revision as of 13:10, 18 July 2013


Grid Redstone.png  Function vector.new
Creates a vector.
Syntax vector.new(number x, number y, number z)
Returns vector
Part of ComputerCraft
API vector

Examples

Grid paper.png  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