1. Home
  2. Computing & Technology
  3. PHP / MySQL

Cosh () PHP Function

By Angela Bradley, About.com

Definition: The Cosh () function in PHP is used to find the hyperbolic cosine. Cosh (x) will give you the hyperbolic cosine of x, which can also be calculated as exp(x) + exp(-x))/2, where exp(x) is e raised to the power of x.
Also Known As: Hyperbolic Cosine
Examples:
<?php
echo(cosh(1) . "<br />");
echo((exp(1) + exp(-1))/2 . "<br />");
echo(cosh(0) . "<br />");
echo(cosh(-1) . "<br />");
?>

This will return the results:
1.5430806348152
1.5430806348152
1
1.5430806348152

Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. PHP Functions
  5. Cosh - Hyperbolic Cosine in PHP

©2009 About.com, a part of The New York Times Company.

All rights reserved.