Skip to content

Instantly share code, notes, and snippets.

View ample-samples's full-sized avatar

Todd Griffin ample-samples

View GitHub Profile
@ample-samples
ample-samples / dot-product.lua
Last active May 5, 2024 03:29
Get the dot product of any MxN matrices
-- Utility functions for matrix.dot
local function dotScalar1dVector(scalar, v1)
local outputVector = {}
for i = 1, #v1, 1 do
outputVector[i] = v1[i] * scalar
end
return matrix(outputVector)
end
local function dotScalar2dVector(scalar, v1)