Mathematische Funktionen

Inhaltsverzeichnis

  • abs — Absolutwert bzw. Betrag
  • acos — Arkuskosinus
  • acosh — Areakosinus hyperbolikus
  • asin — Arkussinus
  • asinh — Areasinus hyperbolikus
  • atan — Arkustangens
  • atan2 — Arkustangens-Variante mit zwei Parametern
  • atanh — Areatangens hyperbolikus
  • base_convert — Wandelt einen numerischen Wert zwischen verschiedenen Zahlensystemen um
  • bindec — Wandelt von binär zu dezimal um
  • ceil — Rundet Brüche auf
  • cos — Kosinus
  • cosh — Kosinus hyperbolikus
  • decbin — Wandelt von dezimal zu binär um
  • dechex — Wandelt von dezimal zu hexadezimal um
  • decoct — Wandelt von dezimal zu oktal um
  • deg2rad — Rechnet einen Winkel von Grad in Bogenmaß um
  • exp — Berechnet den Exponenten von e
  • expm1 — Berechnet exp(Zahl) - 1 mit guter Genauigkeit, auch wenn Zahl nahe bei Null liegt
  • fdiv — Dividiert zwei Zahlen gemäß IEEE 754
  • floor — Rundet Brüche ab
  • fmod — Rest einer Gleitkommadivision (Modulus)
  • fpow — Raise one number to the power of another, according to IEEE 754
  • hexdec — Wandelt von hexadezimal zu dezimal um
  • hypot — Berechnet die Länge der Hypotenuse eines rechtwinkligen Dreiecks
  • intdiv — Integer-Division
  • is_finite — Prüft, ob eine Gleitkommazahl endlich ist
  • is_infinite — Prüft, ob eine Gleitkommazahl unendlich ist
  • is_nan — Prüft, ob eine Gleitkommazahl NAN ist
  • log — Natürlicher Logarithmus
  • log10 — Dekadischer Logarithmus (Logarithmus zur Basis 10)
  • log1p — Berechnet log(1 + Zahl) mit guter Genauigkeit, auch wenn Zahl nahe bei Null liegt
  • max — Bestimmt den Maximalwert
  • min — Bestimmt den Minimalwert
  • octdec — Wandelt von oktal zu dezimal um
  • pi — Liefert den Wert von Pi
  • pow — Potenzfunktion
  • rad2deg — Rechnet einen Winkel vom Bogenmaß in Grad um
  • round — Rundet einen Gleitkommawert
  • sin — Sinus
  • sinh — Sinus hyperbolikus
  • sqrt — Quadratwurzel
  • tan — Tangens
  • tanh — Tangens hyperbolikus
add a note

User Contributed Notes 2 notes

up
11
pat.mat AT sympatico DOT com
21 years ago
For people interest in Differential Equations, I've done a function that receive a string like: x^2+x^3 and put it in2x+3x^2 witch is the differantial of the previous equation.In the code there is one thing missing: the $string{$i} is often going outOfBound (Uninitialized string offset: 6 in...)if your error setting is set a little too high... I just dont know how to fix this.So there is the code for differential equation with (+ and -) only:<?function differentiel($equa){    $equa = strtolower($equa);    echo "Equation de depart: ".$equa."<br>";    $final = "";         for($i = 0; $i < strlen($equa); $i++)    {        //Make a new string from the receive $equa        if($equa{$i} == "x" && $equa{$i+1} == "^")        {            $final .= $equa{$i+2};            $final .= "x^";            $final .= $equa{$i+2}-1;        }        elseif($equa{$i} == "+" || $equa{$i} == "-")        {            $final .= $equa{$i};        }        elseif(is_numeric($equa{$i}) && $i == 0)        {            //gerer parenthese et autre terme generaux + gerer ^apres: 2^2            $final .= $equa{$i}."*";        }        elseif(is_numeric($equa{$i}) && $i > 0 && $equa{$i-1} != "^")        {            //gerer ^apres: 2^2            $final .= $equa{$i}."*";        }        elseif($equa{$i} == "^")        {            continue;        }        elseif(is_numeric($equa{$i}) && $equa{$i-1} == "^")        {            continue;        }        else        {            if($equa{$i} == "x")            {                $final .= 1;            }            else            {                $final .= $equa{$i};             }        }    }    //    //Manage multiplication add in the previous string $final    //    $finalMul = "";    for($i = 0; $i < strlen($final); $i++)    {        if(is_numeric($final{$i}) && $final{$i+1} == "*" && is_numeric($final{$i+2}))        {            $finalMul .= $final{$i}*$final{$i+2};        }        elseif($final{$i} == "*")        {            continue;        }        elseif(is_numeric($final{$i}) && $final{$i+1} != "*" && $final{$i-1} == "*")        {            continue;        }        else        {            $finalMul .= $final{$i};            }    }    echo "equa final: ".$finalMul;}?>I know this is not optimal but i've done this quick :)If you guys have any comment just email me.I also want to do this fonction In C to add to phpCore maybe soon...Patoff
up
7
daniel at g-loc dot org
19 years ago
If you're an aviator and needs to calculate windcorrection angles and groundspeed (e.g. during flightplanning) this can be very useful.

$windcorrection = rad2deg(asin((($windspeed * (sin(deg2rad($tt - ($winddirection-180))))/$tas))));
$groundspeed = $tas*cos(deg2rad($windcorrection)) + $windspeed*cos(deg2rad($tt-($winddirection-180)));

You can probably write these lines more beautiful, but they work!
To Top