Module:BlackHoles

-- -- -- @module Module:BlackHoles --   This module is for use in calculating the various physical --   properties of black holes by means of standard mathematical --   formulae. -- @see Template:Md (MureDate) -- @author User:Sebolto --

-- Define new class local BlackHoles = {}

-- Computational pseudo-constants (not actual protected consts) Constants = { G = 6.67408 * (10 ^ -11),  -- "Big G" (m^3 kg^-1 s^-2) S = 1.98847 * (10 ^ 30),   -- Solar mass (kg) C = 299792458,             -- Speed of light (m/s) }

function BlackHoles.main(frame) local method, arguments, params

method = frame.args[1] arguments = mw.text.split(frame.args[2], ",") params = {}

for i = 1, #arguments do   table.insert(params, mw.text.trim(arguments[i])) end

return BlackHoles[method](unpack(params)) end

-- @function calculateRadius -- @param frame -- @return string (formatted Mure date) function BlackHoles.calculateOuterEventHorizonRadius(masses, spin)

-- Declarations local m, a, j

m = masses * Constants.S j = spin * Constants.G * (m ^ 2) a = j / m

return m + ( ( (m ^ 2) - (a ^ 2) ) ^ 0.5) end

return BlackHoles

--