heptagon/examples/extern_C/mathext.c

23 lines
444 B
C
Raw Normal View History

#include <math.h>
#include "mathext.h"
2015-09-17 17:20:31 +02:00
void Mathext__mycos_step(float a, Mathext__mycos_out *out)
{
2015-09-17 17:20:31 +02:00
out->o = cosf(a);
}
2010-07-27 11:32:58 +02:00
2015-09-17 17:20:31 +02:00
void Mathext__st_cos_reset(Mathext__st_cos_mem *self)
2010-07-27 11:32:58 +02:00
{
2015-09-17 17:20:31 +02:00
int j;
2010-07-27 11:32:58 +02:00
self->i = 0;
2015-09-17 17:20:31 +02:00
for(j = 0; j < 100; ++j)
2010-07-27 11:32:58 +02:00
self->mem[j] = 0.0;
}
2015-09-17 17:20:31 +02:00
void Mathext__st_cos_step(float a, Mathext__st_cos_out *out, Mathext__st_cos_mem *self)
2010-07-27 11:32:58 +02:00
{
out->o = self->mem[self->i];
2013-01-25 15:41:34 +01:00
self->i = (self->i+1) % 100;
2015-09-17 17:20:31 +02:00
self->mem[self->i] = cosf(a);
2010-07-27 11:32:58 +02:00
}