Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| Download
| RSS feed
/*
* ap_math.h
*
* Created on: 31 Jan 2016
* Author: Mike
*/
#pragma once
#include <cstdint>
class ap_math
{
public:
ap_math ();
int
ap_sin (int angle);
int
ap_cos (int angle);
unsigned const AP_K = 256;
int AP_SCALE(int x) {return x/AP_K; };
/* the number of steps in 90 degrees */
static int const SINE_SCALING = 4;
static int const SINE_STEPS = (90*SINE_SCALING);
private:
uint8_t sintab[SINE_STEPS];
};