VectorA:dot
From ComputerCraft Wiki
Returns the dot product of two vectors
A dot product can be represented by multiplying the corresponding values together and summing the results.
More information on dot products can be found at [1]
Code representation:
local a = vector.new(1, 2, 3) local b = vector.new(-1, 2, 5) local c = ((a.x * b.x) + (a.y * b.y) + (a.z * b.z)) --c = 18
Code example:
local a = vector.new(1, 2, 3) local b = vector.new(4, 5, 6) local c = a:dot(b) print(c) --32