Описания углов и небольшие правки в библиотеке

This commit is contained in:
Andrey Pokidov 2024-11-23 00:34:35 +07:00
parent aa581a9b2b
commit eaf12b0a08
13 changed files with 120 additions and 22 deletions

49
docs/english/Angle.md Normal file
View file

@ -0,0 +1,49 @@
# Angles
There are no structures for angles in the library. The library represents
angles as floating point numbers of types **float** and **double**.
There are three units of measurement for angles in the library:
* radians (the full round is equal to 2∏ radians)
* degrees (the full round is equal to 360 degrees)
* turns (the full round is equal to 1 turn)
The units of measurement of angles are defined with an enumerated type:
typedef enum {
BG_ANGLE_UNIT_RADIANS = 1,
BG_ANGLE_UNIT_DEGREES = 2,
BG_ANGLE_UNIT_TURNS = 3
} angle_unit_t;
* BG_ANGLE_UNIT_RADIANS is for measurement of angles in radians
* BG_ANGLE_UNIT_DEGREES is for measurement of angles in degrees
* BG_ANGLE_UNIT_TURNS is for measurement of angles in turns
The functions of the library do not require angle values to be limited by any
range. But there are functions which can normalize angles to specific ranges.
There are two ranges of normalized angles: a signed range and an unsigned
range.
The unsigned range has no negative values. The unsigned range corresponds:
* [0, 2∏) radians
* [0, 360) degrees
* [0, 1) turns
The signed range has both positive and negative values. The signed range
corresponds:
* (-∏, ∏] radians
* (-180, 180] degrees
* (-0.5, 0.5] turns
The ranges of angles are defined with an enumerated type:
typedef enum {
BG_ANGLE_RANGE_UNSIGNED = 1,
BG_ANGLE_RANGE_SIGNED = 2
} angle_range_t;
* BG_ANGLE_RANGE_UNSIGNED is for the unsigned range of values;
* BG_ANGLE_RANGE_SIGNED is for the signed range of values.

View file

@ -19,10 +19,10 @@ and **binary64** types of the **IEEE 754** standard).
Thus there are two prefixes of types:
* **FP32** - means **F**loating **P**oint 32 bit, which corresponds to the
* **FP32** - means **F**loating **P**oint, **32** bit, which corresponds to the
**float** type of the C language.
* **FP32** - means **F**loating **P**oint 64 bit, which corresponds to the
* **FP32** - means **F**loating **P**oint, **64** bit, which corresponds to the
**double** type of the C language.
The types of structures which are based in the **float** type have **FP32** as