mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-29 12:10:48 +00:00
implement the invers hyper trig functions locally because they're not
available everywhere.
This commit is contained in:
parent
bb31308953
commit
4843d0adde
1 changed files with 6 additions and 5 deletions
|
@ -125,20 +125,21 @@ bi_tanh (progs_t *pr)
|
|||
static void
|
||||
bi_asinh (progs_t *pr)
|
||||
{
|
||||
R_FLOAT (pr) = asinh (P_FLOAT (pr, 0));
|
||||
double y = P_FLOAT (pr, 0);
|
||||
R_FLOAT (pr) = log (y + sqrt (y * y + 1));
|
||||
}
|
||||
|
||||
static void
|
||||
bi_acosh (progs_t *pr)
|
||||
{
|
||||
R_FLOAT (pr) = acosh (P_FLOAT (pr, 0));
|
||||
}
|
||||
double y = P_FLOAT (pr, 0);
|
||||
R_FLOAT (pr) = log (y + sqrt (y * y - 1));
|
||||
|
||||
static void
|
||||
bi_atanh (progs_t *pr)
|
||||
{
|
||||
R_FLOAT (pr) = atanh (P_FLOAT (pr, 0));
|
||||
}
|
||||
double y = P_FLOAT (pr, 0);
|
||||
R_FLOAT (pr) = log ((1 + y) / (1 - y)) / 2;
|
||||
|
||||
static builtin_t builtins[] = {
|
||||
{"sin", bi_sin, -1},
|
||||
|
|
Loading…
Reference in a new issue