Дополнения в описание проекта / Some addions in the description of the project

This commit is contained in:
Andrey Pokidov 2024-11-22 19:20:18 +07:00
parent 2ef0fc17c2
commit 3245407af4
8 changed files with 252 additions and 6 deletions

44
docs/english/Prefixes.md Normal file
View file

@ -0,0 +1,44 @@
# Prefixes
The library uses prefixes in names of types, constants and functions.
The main prefix is **BG** which means **B**asic **G**eometry.
The structure types have prefix in the form **Bg**. For example: *BgFP64Vector3*,
*BgFP32Versor*, *BgFP32Matrix2x2*.
The constants have prefix in the form **BG_**. For example: *BG_FP32_EPSYLON*,
*BG_FP64_TWO_PI*.
The functions have prefix in the form **bg_**. For example:
*bg_fp32_versor_combine*, *bg_fp64_matrix3x3_subtract*.
A prefix of type follows right after the prefix of the library. The library uses
two types of floating point numbers: **float** and **double** (**binary32**
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
**float** type of the C language.
* **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
the type prefix: BgFP32Vector3, BgFP32Matrix3x2, BgFP32Quaternion
The types of structures which are based in the **double** type have **FP64** as
the type prefix: BgFP64Vector2, BgFP64Matrix2x3, BgFP64Versor
The constants of the **float** type have **FP32_** as the type prefix:
BG_FP32_PI, BG_FP32_EPSYLON.
The constants of the **double** type have **FP64_** as the type prefix:
BG_FP64_HALF_PI, BG_FP64_ONE_THIRD.
The functions which works with data of the **float** type have **fp32_** as
the type prefix: bg_fp32_vector2_get_module, bg_fp32_radians_to_degrees.
The functions which works with data of the **double** type have **fp64_** as
the type prefix: bg_fp64_vector3_reset, bg_fp64_radians_normalize.

26
docs/english/Vector2.md Normal file
View file

@ -0,0 +1,26 @@
# Two dimensional vectors
There are two types for two dimensional vectors:
- BgFP32Vector2 for single precision vectors
- BgFP64Vector2 for double precision vectors
Vectors of BgFP32Vecto2 type use **float** (binary32 of IEEE 754) type to store
coordinate values.
Vectors of BgFP64Vecto2 type use **double** (binary64 of IEEE 754) type to store
coordinate values.
The both types are structures with two fields: **x1** and **x2**
The definition of the types:
typedef struct
{
float x1, x2;
} BgFP32Vector2;
typedef struct
{
double x1, x2;
} BgFP64Vector2;

45
docs/russian/Prefixes.md Normal file
View file

@ -0,0 +1,45 @@
# Префиксы
Библиотека использует префиксы в названиях типов, констант и функций.
Основным префиксом является **BG** (сокращение от Basic Geometry / Базовая
Геометрия).
Для структур данных префикс имеет вид **Bg**, например: BgFP64Vector3,
BgFP32Versor, BgFP32Matrix2x2.
Константы имеют префикс в виде **BG_**, например: BG_FP32_EPSYLON,
BG_FP64_TWO_PI.
Функции имеют префикс в виде **bg_**, например: bg_fp32_versor_combine,
bg_fp64_matrix3x3_subtract.
Сразу после префикса библиотеки идёт префикс типа. Библиотека использует
два типа чисел с плавающей запятой: **float** и **double** (типы **binary32**
и **binary64** стандарта **IEEE 754**).
Поэтому в библиотеке есть два префикса типа:
* **FP32** - означает **F**loating **P**oint 32 bit, то есть, число с
плавающей запятой, 32 бита, что соответствует типу float языка Си.
* **FP64** - означает **F**loating **P**oint 64 bit, то есть, число с
плавающей запятой, 64 бита, что соответствует типу double языка Си.
Типы структур, использующие тип **float** имеют префикс типа в виде **FP32**:
BgFP32Vector3, BgFP32Matrix3x2, BgFP32Quaternion
Типы структур, использующие тип **double** имеют префикс типа в виде **FP64**:
BgFP64Vector2, BgFP64Matrix2x3, BgFP64Versor
Константы типа **float** имеют префикс типа в виде **FP32_**: BG_FP32_PI,
BG_FP32_EPSYLON.
Константы типа **double** имеют префикс типа в виде **FP64_**: BG_FP64_HALF_PI,
BG_FP64_ONE_THIRD.
Функции, которые работают с данными типа **float** имеют префикс **fp32_**:
bg_fp32_vector2_get_module, bg_fp32_radians_to_degrees.
Функции, которые работают с данными типа **double** имеют префикс **fp64_**:
bg_fp64_vector3_reset, bg_fp64_radians_normalize.

25
docs/russian/Vector2.md Normal file
View file

@ -0,0 +1,25 @@
# Двумерные векторы
В библиотеке есть две версии вектора:
- BgFP32Vector2 - вектор одинарной точности
- BgFP64Vector2 - вектор двойной точности
Векторы типа BgFP32Vecto2 для хранения координат использует тип **float** (тип
binary32 стандарта IEEE 754).
Векторы BgFP64Vector2 используют тип **double** (тип binary64 стандарта IEEE 754).
Оба типа представляют собой структуры с двумя полями: **x1** и **x2**.
Определение типов:
typedef struct
{
float x1, x2;
} BgFP32Vector2;
typedef struct
{
double x1, x2;
} BgFP64Vector2;