„Modul:Math“ – Versionsunterschied
Erscheinungsbild
[gesichtete Version] | [gesichtete Version] |
Inhalt gelöscht Inhalt hinzugefügt
Antonsusi verschob die Seite Modul:Math nach Modul:Sports table/Math: Findet nur in Modul Sports table Gebrauch Markierung: Neue Weiterleitung |
K Neu Markierung: Weiterleitung entfernt |
||
Zeile 1: | Zeile 1: | ||
return require [[Modul:Sports table/Math]] |
|||
local function sinh(x) |
|||
-- Sinus hyperbolicus |
|||
x = tonumber(x) or false; |
|||
if not x then return 0, false; end |
|||
local value = (math.exp (x) - math.exp (0 - x)) / 2 |
|||
if value then |
|||
return value, true |
|||
else |
|||
return 0, false |
|||
end |
|||
end |
|||
local function cosh(x) |
|||
-- Cosinus hyperbolicus |
|||
x = tonumber(x) or false; |
|||
if not x then return 1, false; end |
|||
local value = (math.exp (x) + math.exp (0 - x)) / 2 |
|||
if value then |
|||
return value, true |
|||
else |
|||
return 1, false |
|||
end |
|||
end |
Version vom 21. September 2024, 02:19 Uhr
Modul zur Berechnung mathematischer Funktionen, welche nicht im WP-Standard enthalten sind. Bei erlaubten Argumenten wird das Ergebnis zurückgegeben, ansonsten eine leere Zeichenkette.
Zurzeit implementiert:
- Math.sinh: Sinus hyperbolicus
- Math.cosh: Kosinus hyperbolicus
- Math.tanh: Tangens hyperbolicus
- Math.coth: Kotangens hyperbolicus
- Math.arsinh: Area Sinus hyperbolicus
- Math.arcosh: Area Kosinus hyperbolicus
- Math.artanh: Area Tangens hyperbolicus
- Math.arcoth: Area Kotangens hyperbolicus
local function sinh(x)
-- Sinus hyperbolicus
x = tonumber(x) or false;
if not x then return 0, false; end
local value = (math.exp (x) - math.exp (0 - x)) / 2
if value then
return value, true
else
return 0, false
end
end
local function cosh(x)
-- Cosinus hyperbolicus
x = tonumber(x) or false;
if not x then return 1, false; end
local value = (math.exp (x) + math.exp (0 - x)) / 2
if value then
return value, true
else
return 1, false
end
end