Hyperbolic Functions : Math « Math « PHP






Hyperbolic Functions

 
Name           Description 
cosh()         Hyperbolic cosine (exp(arg) + exp(-arg))/2 
sinh()         Hyperbolic sine (exp(arg) - exp(-arg))/2 
tanh()         Hyperbolic tangent sinh(arg)/cosh(arg) 
acosh()        Inverse hyperbolic cosine 
asinh()        Inverse hyperbolic sine 
atanh()        Inverse hyperbolic tangent 

<?php 
$start = array(0, 0); 
$end = array(100, 0); 
$length = sqrt(pow($end[0] - $start[0], 2) + pow($end[1] - $start[1], 2)); 
$angle = 35; 
$r = deg2rad($angle); 
$new_start = array(20, 20); 
$new_end = array( $new_start[0] + cos($r) * $length, $new_start[1] + sin($r) * $length 
); 

var_dump($new_end); 
?>
  
  








Related examples in the same category

1.Create and use a simple static Math() class
2.Math calculation
3.Math operations
4.Mathematical constants