Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

41 righe
578 B

#include "emath.h"
namespace segl {
// Trigonometrische Funktionen
float deg2rad(float deg) {
return (deg/180.0f)*3.1415926535897932384626433f;
}
float rad2deg(float rad) {
return (rad/3.1415926535897932384626433f)*180.0f;
}
float ssin(float c) {
int t=(int)c;
if(t!=c)
return sin(deg2rad(c));
t = t % 360;
if(t<0)
t = 360 + t;
switch(t) {
case 0:
return 0.0f;
case 90:
return 1.0f;
case 180:
return 0.0f;
case 270:
return -1.0f;
default:
return sin(deg2rad(c));
}
}
float scos(float c) {
return ssin(c+90.0f);
}
} // namespace segl