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
?>
tan
georgedot at gmail dot com
11-Sep-2009 05:50
11-Sep-2009 05:50
