Published in: PHP
URL: http://reusablecode.blogspot.com
Library of trigonometry functions, both circular and hyperbolic.
<?php // PHP Mathematics Library - Trigonometry // // Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved. // // This work is licensed under the Creative Commons Attribution License. To view // a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or // send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California // 94305, USA. // CIRCULAR FUNCTIONS // There are six basic trigonometric functions, three of which (sine, cosine, and tangent) are already defined in PHP. // function sin() - Returns the sine of the specified angle. // function cos() - Returns the cosine of the specified angle. // function tan() - Returns the tangent of the specified angle. // The other three basic trigonometric functions are the multiplicative inverses of the previous three functions. // Returns the cosecant of the specified angle. function csc($x) { } // Returns the secant of the specified angle. function sec($x) { } // Returns the cotangent of the specified angle. function cot($x) { } // The following trigonometric functions are rarely used anymore, but are included in this function library for completeness. // Returns the versed sine (also called versine) of the specified angle. function versin($x) { } // Returns the coversed sine (also called coversine) of the specified angle. function coversin($x) { } // Returns the haversed sine (also called haversine) of the specified angle. function haversin($x) { return (versin($x) / 2); } // Returns the hacoversed sine (also called hacoversine, cohaversine, or havercosine) of the specified angle. function hacoversin($x) { return (coversin($x) / 2); } // Returns the exsecant of the specified angle. function exsec($x) { return (sec($x) - 1); } // Returns the excosecant of the specified angle. function excsc($x) { return (csc($x) - 1); } // Each of the six basic trigonometric functions also has an inverse function, three of which are already defined in PHP. // function asin() - Returns the angle whose sine is the specified whole number. // function acos() - Returns the angle whose cosine is the specified number. // function atan() - Returns the angle whose tangent is the specified number. // Returns the angle whose cosecant is the specified number. function acsc($x) { } // Returns the angle whose secant is the specified number. function asec($x) { } // Returns the angle whose cotangent is the specified number. function acot($x) { } // HYPERBOLIC FUNCTIONS // The hyperbolic functions are like the basic trigonometric functions, but for hyperbola instead of circles. // function sinh() - Returns the hyperbolic sine of the specified angle. // function cosh() - Returns the hyperbolic cosine of the specified angle. // function tanh() - Returns the hyperbolic tangent of the specified angle. // Returns the hyperbolic cosecant of the specified angle. function csch($x) { } // Returns the hyperbolic secant of the specified angle. function sech($x) { } // Returns the hyperbolic cotangent of the specified angle. function coth($x) { } // Just like in trigonometry, the six basic hyperbolic functions have inverse functions. // function asinh() - Returns the angle whose hyperbolic sine is the specified number. // function acosh() - Returns the angle whose hyperbolic cosine is the specified number. // function atanh() - Returns the angle whose hyperbolic tangent is the specified number. // Returns the angle whose hyperbolic cosecant is the specified number. function acsch($x) { } // Returns the angle whose hyperbolic secant is the specified number. function asech($x) { } // Returns the angle whose hyperbolic cotangent is the specified number. function acoth($x) { } // GUDERMANNIAN FUNCTIONS // The Gudermannian function relates the circular and hyperbolic trigonometric functions without resorting to complex numbers. function gd($x) { } // Like other trigonometric and hyperbolic functions, Gudermannian has an inverse. function agd($x) { } ?>
You need to login to post a comment.
