Difference between revisions of "VectorA:sub"
From ComputerCraft Wiki
| Line 9: | Line 9: | ||
|examples= | |examples= | ||
{{Example | {{Example | ||
| − | |desc=Subtracts two vectors and prints the resulting components | + | |desc=Subtracts two vectors and prints the resulting components. |
|code=local a = vector.new(1, 2, 3) | |code=local a = vector.new(1, 2, 3) | ||
local b = vector.new(3, 2, 1) | local b = vector.new(3, 2, 1) | ||
local c = a:sub(b) | local c = a:sub(b) | ||
| + | --local c = (a - b) | ||
print(c.x) | print(c.x) | ||
Revision as of 11:54, 23 February 2013
| Subtracts two vectors and returns the result | |
| Syntax | vector:sub(vector vect) |
| Returns | vector |
| Part of | ComputerCraft |
| API | vector |