float cosh(float X);
X is the input value <?Php
echo cosh(0); // Output is 1
echo "<br>";
echo cosh(1); // Output 1.5430806348152
echo "<br>";
echo cosh(-1); // Output 1.5430806348152
echo "<br>";
echo cosh(4.2); // Output is 33.350663308873
echo "<br>";
echo cosh(2); // Output is 3.7621956910836
echo "<br>";
echo cosh(90); // Output is 6.1020164715892E+38
?>
<?php
echo cosh(-0.5); // Output: 1.1276259652064
?>
<?php
echo cosh(100); // Output: A very large number: 1.3440585709081E+43
?>
<?php
// Simulating the shape of a hanging cable (catenary)
$distance = 1.5;
echo cosh($distance); // Output: 2.3524096152432
?>
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.