diff options
| author | Dragorn421 <Dragorn421@users.noreply.github.com> | 2022-10-15 23:29:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-15 17:29:36 -0400 |
| commit | 0283493db8e968be67d9e591ec4719fe9d0477f0 (patch) | |
| tree | 90dbdd87c1942b16522b4c336a3966afd66fb8d9 /src/code/z_lib.c | |
| parent | 0b38f6e6785e52685a80463df3c7c85db878e8ea (diff) | |
Lightweight trigonometry doc (#1356)
* Doc units of trig functions
* "Very simple" yet I made a mistake
* sins returns in [-0x7FFF,0x7FFF] as the [-1,1] range
* Also `sys_math_atan.c`
* Remove `@param`s without descriptions
* Add note on Math_Atan2S/F arguments being unlike atan2
* "from (1,0) to (x,y)" -> "from vector ..."
* arg names -> `angle`
* Improve `@return` comment on atans
Diffstat (limited to 'src/code/z_lib.c')
| -rw-r--r-- | src/code/z_lib.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/code/z_lib.c b/src/code/z_lib.c index 3dd0030f0..ac5220ab0 100644 --- a/src/code/z_lib.c +++ b/src/code/z_lib.c @@ -23,10 +23,18 @@ void Lib_MemSet(u8* dest, size_t len, u8 val) { // clang-format on } +/** + * @param angle binang + * @return cos(angle) + */ f32 Math_CosS(s16 angle) { return coss(angle) * SHT_MINV; } +/** + * @param angle binang + * @return sin(angle) + */ f32 Math_SinS(s16 angle) { return sins(angle) * SHT_MINV; } |
