Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4 | mjames | 1 | /* |
2 | * ap_math.h |
||
3 | * |
||
4 | * Created on: 31 Jan 2016 |
||
5 | * Author: Mike |
||
6 | */ |
||
7 | |||
8 | #pragma once |
||
9 | |||
10 | #include <cstdint> |
||
11 | |||
12 | |||
13 | class ap_math |
||
14 | { |
||
15 | public: |
||
16 | ap_math (); |
||
17 | |||
18 | int |
||
19 | ap_sin (int angle); |
||
20 | |||
21 | int |
||
22 | ap_cos (int angle); |
||
23 | |||
24 | unsigned const AP_K = 256; |
||
25 | |||
26 | int AP_SCALE(int x) {return x/AP_K; }; |
||
27 | |||
28 | /* the number of steps in 90 degrees */ |
||
29 | static int const SINE_SCALING = 4; |
||
30 | static int const SINE_STEPS = (90*SINE_SCALING); |
||
31 | |||
32 | private: |
||
33 | |||
34 | |||
35 | |||
36 | uint8_t sintab[SINE_STEPS]; |
||
37 | |||
38 | }; |
||
39 |