We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
vector:normalize()
1 parent b48e105 commit c026a97Copy full SHA for c026a97
.spec/math/vector_spec.lua
@@ -52,6 +52,7 @@ describe("Vector", function()
52
it("normalization", function()
53
assert.same(vector.new({ 1, 2, 2 }) / 3, vector.new({ 1, 2, 2 }):normalize())
54
assert.same(vector.new({ 4, 13, 16 }) / 21, vector.new({ 4, 13, 16 }):normalize())
55
+ assert.same(vector.new({ 0, 0 }), vector.new({ 0, 0 }):normalize())
56
end)
57
it("angle between vectors", function()
58
assert_almost_equal(math.pi, vector.new({ 1, 1, 1 }):angle(vector.new({ -1, -1, -1 })))
0 commit comments