Актуализация документации по проекту

This commit is contained in:
Andrey Pokidov 2026-03-31 20:43:10 +07:00
parent ed404690ed
commit 8ba075b557
16 changed files with 279 additions and 222 deletions

View file

@ -4,53 +4,66 @@
## Naming
### Prefixes
C programming language does not have namespaces, thus prefixes often play role of namespaces in C code.
C programming language does not have namespaces, thus prefixes often play role
of namespaces in C code.
The library uses prefixes in names of types, constants and functions to avoid name conflict with of othr libraries.
The library uses prefixes in names of types, constants and functions to avoid
name conflict with of othr libraries.
### Library prefix (the main prefix)
The main prefix is **BGC** which means **B**asic **G**eometric **C**omputations.
The structure types and contstans have prefix in the form **Bgc**. For example:
BGC_FP64_Vector3, BGC_FP32_Quaternion, BGC_FP32_Matrix2x2, BGC_FP32_EPSILON,
BGC_FP64_TWO_PI.
The structure types and the contstans have prefix in the form **BGC_**.
The constants have prefix in the form **BGC_**. For example: BGC_EPSYLON_FP32,
BGC_TWO_PI_FP64.
For example, structures:
- BGC_FP64_Vector3
- BGC_FP32_Quaternion
- BGC_FP32_Matrix2x2
The functions have prefix in the form **bgc_**. For example:
bgc_fp32_turn3_combine, bgc_fp64_matrix3x3_subtract.
Constants:
- BGC_FP32_EPSILON
- BGC_FP64_TWO_PI
### Suffixes
The functions have prefix in the form **bgc_**, for example:
- bgc_fp32_turn3_combine
- bgc_fp64_matrix3x3_subtract
Suffixs of type ends the names of constats, types and functions of the library.
The library uses two types of floating point numbers: **float** and **double**
(**binary32** and **binary64** types of the **IEEE 754** standard).
### Basic type prefix (the secondary prefix)
Thus there are two suffixes of types:
Prefixs of type ends the names of constats, types and functions of the library.
* **FP32** - means **F**loating **P**oint, **32** bit, which corresponds to the
**float** type of the C language.
The library uses two types of floating point numbers: **float** and **double** (**binary32** and **binary64** types of the **IEEE 754** standard).
* **FP64** - means **F**loating **P**oint, **64** bit, which corresponds to the
**double** type of the C language.
Thus there are two prefixes of types:
- **FP32** - means **F**loating **P**oint, **32** bit, which corresponds to the **float** type of the C programming language.
- **FP64** - means **F**loating **P**oint, **64** bit, which corresponds to the **double** type of the C programming language.
The constants and the types of structures which are based in the **float** type
have **FP32** as the type prefix: BGC_FP32_Vector3, BGC_FP32_Matrix3x2,
BGC_FP32_Quaternion, BGC_FP32_PI, BGC_FP32_EPSILON.
The constants and the types of structures which are based in the **float** type have **FP32_** as the type prefix:
- BGC_FP32_Vector3
- BGC_FP32_Matrix3x2
- BGC_FP32_Quaternion
- BGC_FP32_PI
- BGC_FP32_EPSILON
The constants and the types of structures which are based in the **double** type
have **FP64** as the type prefix: BGC_FP64_Vector2, BGC_FP64_Matrix2x3,
BGC_FP64_Turn3, BGC_FP64_HALF_PI, BGC_FP64_ONE_THIRD.
The constants and the types of structures which are based in the **double** type have **FP64_** as the type prefix:
- BGC_FP64_Vector2
- BGC_FP64_Matrix2x3
- BGC_FP64_Turn3
- BGC_FP64_HALF_PI
- BGC_FP64_ONE_THIRD
The functions which works with data of the **float** type have **_fp32** as
the type suffix: bcg_fp32_vector2_get_length, bgc_fp32_radians_to_degrees.
The functions which works with data of the **float** type have **fp32_** as the type prefix:
- bcg_fp32_vector2_get_length
- bgc_fp32_radians_to_degrees
The functions which works with data of the **double** type have **_fp64** as
the type suffix: bgc_fp64_vector3_reset, bgc_fp64_normalize_radians.
The functions which works with data of the **double** type have **fp64_** as the type prefix:
- bgc_fp64_vector3_reset
- bgc_fp64_normalize_radians.
Using of such prefixes of a basic type allows to enhance the library with new basic types in future.
### Data types
- [2D-vectors](vector2-eng.md)
- [3D-vectors](vector3-eng.md)
- [Quaternions](quaternion-rus.md)
Using of such prefixes of a basic type allows to enhance the library with new
basic types in future.