The math functions commonly used in php tutorials
The tanh () function returns the hyperbolic tangent.
grammar
tanh (x) Parameter Description
x Required. A few.
Description Returns the hyperbolic tangent of x, defined as sinh (arg) / cosh (arg).
* /
echo tanh (-m_pi); // Output -0.996272076221
echo "<br>";
echo tanh (1/2); // Output .46211715726
echo "<br>";
echo tanh (m_pi); // Output 0.996272076221 / *
The tan () function returns the tangent.
grammar
tan (x) Parameter Description
x Required. A few.
Description
tan () Returns the tangent of parameter x. The unit of parameter x is radian
* /
echo tan (0); // output 0
echo "<br>";
echo tan (m_pi / 4); // Output 1
echo "<br>";
echo tan (3 * m_pi / 4); // output -1 / *
sinh () function php math function definition and usage sinh () function returns a number of hyperbolic sine. Syntax sinh (x) Parameter Description x Required. A number
* /
echo sinh (-m_pi); // Output -11.5487393573
echo "<br>";
echo sinh (1/2); // Output 0.521095305494
echo "<br>";
echo sinh (m_pi); // Output 11.5487393573
/ *
The sin () function returns the sine of a number.
grammar
sin (x) Parameter description
x Required. A few.
Description
sin () returns the sine of parameter x. The unit of parameter x is radian.
* /
echo sin (0); // output 0
echo "<br>";
echo sin (m_pi / 6); // Output 0.5
echo "<br>";
echo sin (7 * m_pi / 6); // output -0.5 / *
The cosh () function returns the hyperbolic cosine of a number.
grammar
cosh (x) Parameter Description
x Required. A few.
Description Returns the hyperbolic cosine of x, defined as (exp (arg) + exp (-arg)) / 2.
* /
echo cosh (-m_pi); // Output 11.5919532755
echo "<br>";
echo cosh (1/2); // Output 1.12762596521
echo "<br>";
echo cosh (m_pi); // Output 11.5919532755
/ *
The cos () function returns the cosine of a number.
grammar
cos (x) Parameter description
x Required. A few.
Description
cos () Returns the cosine of parameter x. The unit of parameter x is radian.
* /
echo cos (-m_pi); // Output -1
echo "<br>";
echo cos (m_pi / 3); // Output 0.5
echo "<br>";
echo cos (m_pi); // output 1 / *
The atan () function returns the arctangent of a number with a return between -pi / 2 and pi / 2.
* /
echo atan (-1); // Output -0.785398163397
echo "<br>";
echo atan (1/2); // Output 0.463647609001
echo "<br>";
echo atan (1); // Output 0.785398163397