Workaround for cotangent function
<?php
//FOR PHP 4
function cot($rad)
{
return tan(M_PI_2 - rad2deg($rad));
}
//FOR PHP 3
function cot($rad)
{
return tan(M_PI/2 - rad2deg($rad));
}
?>
tan
(PHP 4, PHP 5)
tan — 탄젠트
설명
float tan
( float $arg
)
tan()는 arg 인수의 탄젠트 값을 반환합니다. arg 인수는 라디안으로 주어집니다.
인수
- arg
-
계산할 라디안 인수
반환값
arg의 탄젠트
예제
Example #1 tan() 예제
<?php
echo tan(M_PI_4); // 1
?>
georgedot at gmail dot com
10-Sep-2009 01:50
fformula at gmail dot com
10-Apr-2006 05:26
To find cotangent you can use
tan (M_PI/2 - $alfa)
