vectorA:sub
From ComputerCraft Wiki
Function vector:sub | |
Subtracts two vectors and returns the result | |
Syntax | vector:sub(vector vect) |
Returns | vector |
Part of | ComputerCraft |
API | vector |
Examples
Example | |
Subtracts two vectors and prints the resulting components | |
Code |
local a = vector.new(1, 2, 3) local b = vector.new(3, 2, 1) local c = a:sub(b) print(c.x) print(c.y) print(c.z) --(-2) --0 --2 |