Исправление названий в документации

This commit is contained in:
Andrey Pokidov 2025-02-05 00:03:55 +07:00
parent c8f5a3f077
commit 847c022533
13 changed files with 104 additions and 104 deletions

View file

@ -36,5 +36,5 @@ functions of **float** type and another one is for date of th **double** type.
And there are several bridges connect both of the halves. Those bridges are
the functions of the type conversion.
But there are no functions which use data of different types (**float** and
**double** at the same time) for the computations.
But there are just few functions which use data of different types (**float**
and **double** at the same time) for the computations.

View file

@ -11,14 +11,14 @@ There are three units of measurement for angles in the library:
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;
BGC_ANGLE_UNIT_RADIANS = 1,
BGC_ANGLE_UNIT_DEGREES = 2,
BGC_ANGLE_UNIT_TURNS = 3
} BgcAngleUnitEnum;
* 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
* BGC_ANGLE_UNIT_RADIANS is for measurement of angles in radians
* BGC_ANGLE_UNIT_DEGREES is for measurement of angles in degrees
* BGC_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.
@ -40,9 +40,9 @@ corresponds:
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;
BGC_ANGLE_RANGE_UNSIGNED = 1,
BGC_ANGLE_RANGE_SIGNED = 2
} BgcAngleRangeEnum;
* BG_ANGLE_RANGE_UNSIGNED is for the unsigned range of values;
* BG_ANGLE_RANGE_SIGNED is for the signed range of values.
* BGC_ANGLE_RANGE_UNSIGNED is for the unsigned range of values;
* BGC_ANGLE_RANGE_SIGNED is for the signed range of values.

View file

@ -12,14 +12,14 @@
Единицы измерения углов определены в перечилении:
typedef enum {
BG_ANGLE_UNIT_RADIANS = 1,
BG_ANGLE_UNIT_DEGREES = 2,
BG_ANGLE_UNIT_TURNS = 3
} angle_unit_t;
BGC_ANGLE_UNIT_RADIANS = 1,
BGC_ANGLE_UNIT_DEGREES = 2,
BGC_ANGLE_UNIT_TURNS = 3
} BgcAngleUnitEnum;
* BG_ANGLE_UNIT_RADIANS для уголов, измеряемых в радианах
* BG_ANGLE_UNIT_DEGREES для уголов, измеряемых в градусах
* BG_ANGLE_UNIT_TURNS для уголов, измеряемых в оборотах
* BGC_ANGLE_UNIT_RADIANS для уголов, измеряемых в радианах
* BGC_ANGLE_UNIT_DEGREES для уголов, измеряемых в градусах
* BGC_ANGLE_UNIT_TURNS для уголов, измеряемых в оборотах
Функции, которые принимают угол в качестве параметра, не требуют, чтобы
угол принадлежал какому-либо промежутку значений. Но в библиотеке есть
@ -43,9 +43,9 @@
Диапазоны значений определены перечиляемым типом:
typedef enum {
BG_ANGLE_RANGE_UNSIGNED = 1,
BG_ANGLE_RANGE_SIGNED = 2
} angle_range_t;
BGC_ANGLE_RANGE_UNSIGNED = 1,
BGC_ANGLE_RANGE_SIGNED = 2
} BgcAngleRangeEnum;
* BG_ANGLE_RANGE_UNSIGNED для беззнакового диапазона значений;
* BG_ANGLE_RANGE_SIGNED для знакового диапазона значений.
* BGC_ANGLE_RANGE_UNSIGNED для беззнакового диапазона значений;
* BGC_ANGLE_RANGE_SIGNED для знакового диапазона значений.

View file

@ -1,23 +1,23 @@
# Prefixes
# Prefixes and Suffixes
The library uses prefixes in names of types, constants and functions.
The main prefix is **BG** which means **B**asic **G**eometry.
The main prefix is **BGC** which means **B**asic **G**eometric **C**omputations.
The structure types have prefix in the form **Bg**. For example: BgFP64Vector3,
BgFP32Versor, BgFP32Matrix2x2.
The structure types have prefix in the form **Bgc**. For example: BgcVector3FP64,
BgcVersorFP32, BgcMatrix2x2FP32.
The constants have prefix in the form **BG_**. For example: BG_FP32_EPSYLON,
BG_FP64_TWO_PI.
The constants have prefix in the form **BGC_**. For example: BGC_EPSYLON_FP32,
BGC_TWO_PI_FP64.
The functions have prefix in the form **bg_**. For example:
bg_fp32_versor_combine, bg_fp64_matrix3x3_subtract.
The functions have prefix in the form **bgc_**. For example:
bgc_versor_combine_fp32, bgc_matrix3x3_subtract_fp32.
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).
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).
Thus there are two prefixes of types:
Thus there are two suffixes of types:
* **FP32** - means **F**loating **P**oint, **32** bit, which corresponds to the
**float** type of the C language.
@ -26,19 +26,19 @@ Thus there are two prefixes of types:
**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 type prefix: BgcVector3FP32, BgcMatrix3x2FP32, BgcQuaternionFP32.
The types of structures which are based in the **double** type have **FP64** as
the type prefix: BgFP64Vector2, BgFP64Matrix2x3, BgFP64Versor
the type prefix: BgcVector2FP64, BgcMatrix2x3FP64, BgcVersorFP64.
The constants of the **float** type have **FP32_** as the type prefix:
BG_FP32_PI, BG_FP32_EPSYLON.
The constants of the **float** type have **_FP32** as the type suffix:
BGC_PI_FP32, BGC_EPSYLON_FP32.
The constants of the **double** type have **FP64_** as the type prefix:
BG_FP64_HALF_PI, BG_FP64_ONE_THIRD.
The constants of the **double** type have **_FP64** as the type suffix:
BGC_HALF_PI_FP64, BGC_ONE_THIRD_FP64.
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 **float** type have **_fp32** as
the type suffix: bgc_vector2_get_modulus_fp64, bgc_radians_to_degrees_fp32.
The functions which works with data of the **double** type have **fp64_** as
the type prefix: bg_fp64_vector3_reset, bg_fp64_radians_normalize.
The functions which works with data of the **double** type have **_fp64** as
the type suffix: bgc_vector3_reset_fp64, bgc_radians_normalize_fp64.

View file

@ -2,21 +2,22 @@
Библиотека использует префиксы в названиях типов, констант и функций.
Основным префиксом является **BG** (сокращение от **B**asic **G**eometry / Базовая
Геометрия).
Основным префиксом является **BGC** (сокращение от **B**asic **G**eometric
**C**omputations / Базовые Геометрие Вычисления).
Для структур данных префикс имеет вид **Bg**, например: BgFP64Vector3,
BgFP32Versor, BgFP32Matrix2x2.
Для структур данных префикс имеет вид **Bgc**, например: BgcVector3FP64,
BgcVersorFP32, BgcMatrix2x2FP32.
Константы имеют префикс в виде **BG_**, например: BG_FP32_EPSYLON,
BG_FP64_TWO_PI.
Константы имеют префикс в виде **BGC_**, например: BGC_EPSYLON_FP32,
BGC_TWO_PI_FP64.
Функции имеют префикс в виде **bg_**, например: bg_fp32_versor_combine,
bg_fp64_matrix3x3_subtract.
Функции имеют префикс в виде **bgc_**, например: bgc_versor_combine_fp32,
bgc_matrix3x3_subtract_fp64.
Сразу после префикса библиотеки идёт префикс типа. Библиотека использует
два типа чисел с плавающей запятой: **float** и **double** (типы **binary32**
и **binary64** стандарта **IEEE 754**).
Названия констант, типов и функций оканчиваются суффиксом, указывающим на
базовый тип. Библиотека использует два типа чисел с плавающей запятой:
**float** и **double** (типы **binary32** и **binary64** стандарта
**IEEE 754**).
Поэтому в библиотеке есть два префикса типа:
@ -26,20 +27,19 @@ bg_fp64_matrix3x3_subtract.
* **FP64** - означает **F**loating **P**oint **64** bit, то есть, число с
плавающей запятой, 64 бита, что соответствует типу **double** языка Си.
Типы структур, использующие тип **float** имеют префикс типа в виде **FP32**:
BgFP32Vector3, BgFP32Matrix3x2, BgFP32Quaternion
Типы структур, использующие тип **float** имеют суффикс **FP32**:
BgcVector3FP32, BgcMatrix3x2FP32, BgcQuaternionFP32
Типы структур, использующие тип **double** имеют префикс типа в виде **FP64**:
BgFP64Vector2, BgFP64Matrix2x3, BgFP64Versor
Типы структур, использующие тип **double** имеют суффикс **FP64**:
BgcVector2FP64, BgcMatrix2x3FP64, BgcVersorFP64
Константы типа **float** имеют префикс типа в виде **FP32_**: BG_FP32_PI,
BG_FP32_EPSYLON.
Константы типа **float** имеют суффикс **FP32_**: BGC_PI_FP32, BGC_EPSYLON_FP32.
Константы типа **double** имеют префикс типа в виде **FP64_**: BG_FP64_HALF_PI,
BG_FP64_ONE_THIRD.
Константы типа **double** имеют суффикс **FP64_**: BGC_HALF_PI_FP64,
BGC_ONE_THIRD_FP64.
Функции, которые работают с данными типа **float** имеют префикс **fp32_**:
bg_fp32_vector2_get_module, bg_fp32_radians_to_degrees.
Функции, которые работают с данными типа **float** имеют суффикс **_fp32**:
bcg_vector2_get_modulus_fp32, bgc_radians_to_degrees_fp32.
Функции, которые работают с данными типа **double** имеют префикс **fp64_**:
bg_fp64_vector3_reset, bg_fp64_radians_normalize.
Функции, которые работают с данными типа **double** имеют суффикс **_fp64**:
bgc_vector3_reset_fp64, bgc_radians_normalize_fp64.

View file

@ -67,22 +67,22 @@ There two structural types for quaternions:
typedef struct {
float s0, x1, x2, x3;
} BgFP32Quaternion;
} BgcQuaternionFP32;
typedef struct {
double s0, x1, x2, x3;
} BgFP64Quaternion;
} BgcQuaternionFP64;
And there are two strucutral types for versors:
typedef struct {
const float s0, x1, x2, x3;
} BgFP32Versor;
} BgcVersorFP32;
typedef struct {
const double s0, x1, x2, x3;
} BgFP64Versor;
} BgcVersorFP64;
As you can see there is a difference in the definision of quaternions and
versors: the fields of versors are const while the fields of quaternions

View file

@ -67,22 +67,22 @@
typedef struct {
float s0, x1, x2, x3;
} BgFP32Quaternion;
} BgcQuaternionFP32;
typedef struct {
double s0, x1, x2, x3;
} BgFP64Quaternion;
} BgcQuaternionFP64;
Для описания версоров также имеется две структуры:
typedef struct {
const float s0, x1, x2, x3;
} BgFP32Versor;
} BgcVersorFP32;
typedef struct {
const double s0, x1, x2, x3;
} BgFP64Versor;
} BgcVersorFP64;
Уже в определении структур можно заметить разницу между в реализации
кватернионов и версоров: поля версоров объявлены как константы, в то время как

View file

@ -1,8 +1,8 @@
# Two dimensional vectors
There are two types for two dimensional vectors:
- BgFP32Vector2 for single precision vectors
- BgFP64Vector2 for double precision vectors
- BgcVector2FP32 for single precision vectors
- BgcVector2FP64 for double precision vectors
Vectors of BgFP32Vecto2 type use **float** (binary32 of IEEE 754) type to store
coordinate values.
@ -17,10 +17,10 @@ The definition of the types:
typedef struct
{
float x1, x2;
} BgFP32Vector2;
} BgcVector2FP32;
typedef struct
{
double x1, x2;
} BgFP64Vector2;
} BgcVector2FP64;

View file

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

View file

@ -37,19 +37,19 @@ Versors are quaternions of unit length.
The library has a separate implementation for versors in the form of special
structures and a set of functions that keep the modulus of a versorclose to one.
There are two structures for versors: **BgFP32Versor** and **BgFP64Versor**:
There are two structures for versors: **BgcVersorFP32** and **BgcVersorFP64**:
typedef struct {
const float s0, x1, x2, x3;
} BgFP32Versor;
} BgcVersorFP32;
typedef struct {
const double s0, x1, x2, x3;
} BgFP64Versor;
} BgcVersorFP64;
The fields are deliberately declared const so that a developer using these
structures is not tempted to change the values of the fields directly.
With these structures, it is better to use special functions that allow you
to save new values in the structure fields of **BgFP32Versor** and
**BgFP64Versor**.
to save new values in the structure fields of **BgcVersorFP32** and
**BgcVersorFP64**.

View file

@ -32,11 +32,11 @@
typedef struct {
const float s0, x1, x2, x3;
} BgFP32Versor;
} BgcVersorFP32;
typedef struct {
const double s0, x1, x2, x3;
} BgFP64Versor;
} BgcVersorFP64;
Поля структур намеренно объявлены констрантными (const), чтобы побудить
разработчика использовать функции работы с версорами, вместо того, чтобы
@ -44,6 +44,6 @@
модуль версора равным единицы.
С данными структурами лучше использовать специальные функции, которые позволяют
устанавливать новые значения в поля структур **BgFP32Versor** и
**BgFP64Versor**.
устанавливать новые значения в поля структур **BgcVersorFP32** и
**BgcVersorFP64**.

View file

@ -6,11 +6,11 @@ The functions reset the state of versors to the state of no turn:
For the **BgFP32Versor** type the function is:
void bg_fp32_versor_reset(BgFP32Versor* versor);
void bgc_versor_reset_fp32(BgFP32Versor* versor);
For the **BgFP64Versor** type the function is:
void bg_fp64_versor_reset(BgFP64Versor* versor);
void bgc_versor_reset_fp64(BgFP64Versor* versor);
These functions are good for setting the initial state of variables and fields
of **BgFP32Versor** and **BgFP64Versor** types.
@ -23,7 +23,7 @@ Example of usage:
int main() {
BgFP32Versor versor;
bg_fp32_versor_reset(&versor);
bgc_versor_reset_fp32(&versor);
printf("Versor: (%f, %f, %f, %f)\n", versor.s0, versor.x1, versor.x2, versor.x3);

View file

@ -7,11 +7,11 @@
Для типа **BgFP32Versor** функция имеет вид:
void bg_fp32_versor_reset(BgFP32Versor* versor);
void bgc_versor_reset_fp32(BgFP32Versor* versor);
Для типа **BgFP64Versor** функция имеет вид:
void bg_fp64_versor_reset(BgFP64Versor* versor);
void bgc_versor_reset_fp64(BgFP64Versor* versor);
Данные функции хорошо подходят для инициализации состояния переменной типов
**BgFP32Versor** и **BgFP64Versor**.
@ -24,7 +24,7 @@
int main() {
BgFP32Versor versor;
bg_fp32_versor_reset(&versor);
bgc_versor_reset_fp32(&versor);
printf("Versor: (%f, %f, %f, %f)\n", versor.s0, versor.x1, versor.x2, versor.x3);