- Adapted indenation to new agreed upon system
- Added support for second generation scriptcontext based counter
This commit is contained in:
66
trigd.c
66
trigd.c
@ -15,98 +15,106 @@
|
||||
/*******************************************************************************/
|
||||
double Sign(double d)
|
||||
{
|
||||
if(d < .0){
|
||||
if (d < .0) {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Sinus of angle in degrees.
|
||||
*******************************************************************************/
|
||||
extern double Sind (double x)
|
||||
extern double Sind(double x)
|
||||
{
|
||||
return (sin (x*DEGREE_RAD));
|
||||
return (sin(x * DEGREE_RAD));
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Tangens of angle in degrees.
|
||||
*******************************************************************************/
|
||||
extern double Tand(double x)
|
||||
{
|
||||
return (tan(x*DEGREE_RAD));
|
||||
return (tan(x * DEGREE_RAD));
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* cotangens of angle in degrees
|
||||
*****************************************************************************/
|
||||
extern double Cotd(double x){
|
||||
if(tan(x*DEGREE_RAD) > .00001){
|
||||
return (1./tan(x*DEGREE_RAD));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
extern double Cotd(double x)
|
||||
{
|
||||
if (tan(x * DEGREE_RAD) > .00001) {
|
||||
return (1. / tan(x * DEGREE_RAD));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Cosinus of angle in degrees.
|
||||
*******************************************************************************/
|
||||
extern double Cosd (double x)
|
||||
extern double Cosd(double x)
|
||||
{
|
||||
return (cos (x*DEGREE_RAD));
|
||||
return (cos(x * DEGREE_RAD));
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Atan of angle in degrees.
|
||||
*******************************************************************************/
|
||||
extern double Atand (double x)
|
||||
extern double Atand(double x)
|
||||
{
|
||||
double data;
|
||||
|
||||
data = (atan(x)/DEGREE_RAD);
|
||||
data = (atan(x) / DEGREE_RAD);
|
||||
return (data);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Atan of angle in degrees.
|
||||
*******************************************************************************/
|
||||
extern double Atan2d (double x, double y)
|
||||
extern double Atan2d(double x, double y)
|
||||
{
|
||||
double data;
|
||||
|
||||
data = (atan2(x,y)/DEGREE_RAD);
|
||||
data = (atan2(x, y) / DEGREE_RAD);
|
||||
return (data);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Atan2 of angle in degrees.
|
||||
*******************************************************************************/
|
||||
extern double Atand2 (double x)
|
||||
extern double Atand2(double x)
|
||||
{
|
||||
double data;
|
||||
|
||||
data = (atan(x)/DEGREE_RAD);
|
||||
data = (atan(x) / DEGREE_RAD);
|
||||
return (data);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Acos of angle in degrees.
|
||||
*******************************************************************************/
|
||||
extern double Acosd (double x)
|
||||
extern double Acosd(double x)
|
||||
{
|
||||
double data;
|
||||
|
||||
data = acos(x)/DEGREE_RAD;
|
||||
data = acos(x) / DEGREE_RAD;
|
||||
return (data);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Asin of angle in degrees.
|
||||
*******************************************************************************/
|
||||
extern double Asind (double x)
|
||||
extern double Asind(double x)
|
||||
{
|
||||
double data;
|
||||
|
||||
data = x*x;
|
||||
data = x * x;
|
||||
if (data == 1.0)
|
||||
return (180.00 - Sign (x)*90.00);
|
||||
else if (data > 1)
|
||||
{
|
||||
return (180.00 - Sign(x) * 90.00);
|
||||
else if (data > 1) {
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
return (Atand (x/sqrt (1 - data)));
|
||||
} else
|
||||
return (Atand(x / sqrt(1 - data)));
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user