Both ASP and PHP contain three basic trigonometry functions: sin(), cos(), and tan(). You may remember from school that there are three more basic trigonometry functions: cosecant, secant, and cotangent. It might be handy to have some functions for these too.
ASP
function csc(x)
csc = 1 / sin(x)
end function
function sec(x)
sec = 1 / cos(x)
end function
function cot(x)
cot = 1 / tan(x)
end function
PHP
function csc($x)
{
return (1 / sin($x));
}
function sec($x)
{
return (1 / cos($x));
}
function cot($x)
{
return (1 / tan($x));
}
Next week we'll build off some of these basic functions to make some special functions.
No comments:
Post a Comment