Rev 4 |
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();
/* returns AP_SCALE * sin(ang) where ang is in degrees * SINE_SCALING*/
int ap_sin(int angle);
/* returns AP_SCALE * sin(cos) where ang is in degrees * SINE_SCALING */
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);
};