Skip to content

Commit

Permalink
Format file after StyLua upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
appgurueu committed Nov 5, 2023
1 parent 6b55674 commit 4de494e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/math/complex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ local complex = {}
local metatable = { __index = complex }

function complex.new(
real, --[[number, real part]]
imaginary --[[number, imaginary part, defaults to 0]]
real, -- number, real part
imaginary -- number, imaginary part, defaults to 0
)
return setmetatable({ real = real, imaginary = imaginary or 0 }, metatable)
end
Expand All @@ -17,8 +17,8 @@ end
complex.i = complex.new(0, 1)

function complex.from_polar_coordinates(
angle, --[[number, angle in radians]]
abs --[[number, radius / norm / length]]
angle, -- number, angle in radians
abs -- number, radius / norm / length
)
return complex.new(abs * math.cos(angle), abs * math.sin(angle))
end
Expand Down Expand Up @@ -99,8 +99,8 @@ end)

function complex:to_polar_coordinates()
local angle, abs = math.atan2(self.imaginary, self.real), self:abs()
return angle --[[number, angle in radians]],
abs --[[number, radius / norm / length]]
return angle, -- number, angle in radians
abs -- number, radius / norm / length
end

function metatable:__tostring()
Expand Down

0 comments on commit 4de494e

Please sign in to comment.