1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-10 01:44:36 +00:00

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
This commit is contained in:
Dragorn421 2022-10-15 23:29:36 +02:00 committed by GitHub
parent 0b38f6e678
commit 0283493db8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 104 additions and 40 deletions

View file

@ -38,10 +38,18 @@ f32 Math_PowF(f32 base, s32 exp) {
return ret;
}
/**
* @param angle radians
* @return sin(angle)
*/
f32 Math_SinF(f32 angle) {
return sins((s16)(angle * (0x7FFF / M_PI))) * SHT_MINV;
}
/**
* @param angle radians
* @return cos(angle)
*/
f32 Math_CosF(f32 angle) {
return coss((s16)(angle * (0x7FFF / M_PI))) * SHT_MINV;
}