Difference between revisions of "Vector.new"

From ComputerCraft Wiki
Jump to: navigation, search
Line 3: Line 3:
 
|name=vector.new
 
|name=vector.new
 
|args=[[float (type)|float]] x, [[float (type)|float]] y, [[float (type)|float]] z
 
|args=[[float (type)|float]] x, [[float (type)|float]] y, [[float (type)|float]] z
 +
|returns=[[vector (API)|vector]]
 
|api=vector
 
|api=vector
 
|addon=ComputerCraft
 
|addon=ComputerCraft

Revision as of 11:28, 23 February 2013


Grid Redstone.png  Function vector.new
Creates and returns a vector with the specified coordinates.
Syntax vector.new(float x, float y, float 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