1360 |
mateusz.vi |
1 |
/*
|
|
|
2 |
* Routines for computation of basic transcendental functions sin and cos.
|
|
|
3 |
* These routines use only integers, hence they do not require an FPU nor any
|
|
|
4 |
* kind of FPU emulation. Works reasonably fast even on an 8086 CPU.
|
|
|
5 |
*
|
|
|
6 |
* The results are computed using polynomial approximations. Their precision
|
|
|
7 |
* is not expected to be ideal, but "good enough" for common usage.
|
|
|
8 |
*
|
|
|
9 |
* This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io
|
|
|
10 |
* Published under the terms of the MIT License, as stated below.
|
|
|
11 |
*
|
|
|
12 |
* Copyright (C) 2022 Mateusz Viste
|
|
|
13 |
*
|
|
|
14 |
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
15 |
* of this software and associated documentation files (the "Software"), to
|
|
|
16 |
* deal in the Software without restriction, including without limitation the
|
|
|
17 |
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
18 |
* sell copies of the Software, and to permit persons to whom the Software is
|
|
|
19 |
* furnished to do so, subject to the following conditions:
|
|
|
20 |
*
|
|
|
21 |
* The above copyright notice and this permission notice shall be included in
|
|
|
22 |
* all copies or substantial portions of the Software.
|
|
|
23 |
*
|
|
|
24 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
25 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
26 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
27 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
28 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
29 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
|
30 |
* IN THE SOFTWARE.
|
|
|
31 |
*/
|
|
|
32 |
|
|
|
33 |
#ifndef MDR_TRIGINT_H
|
|
|
34 |
#define MDR_TRIGINT_H
|
|
|
35 |
|
|
|
36 |
/* Computes the cosine value for the given radian.
|
|
|
37 |
* The radian argument must be provided multiplied by 1000.
|
|
|
38 |
* Returns the cosine value multiplied by 1000. */
|
|
|
39 |
short trigint_cos(short rad1000);
|
|
|
40 |
|
|
|
41 |
/* Computes the sine value for the given radian angle.
|
|
|
42 |
* The radian argument must be provided multiplied by 1000.
|
|
|
43 |
* Returns the cosine value multiplied by 1000. */
|
|
|
44 |
short trigint_sin(short rad1000);
|
|
|
45 |
|
|
|
46 |
#endif
|