bgc-c/docs/intro-zho.md

72 lines
2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 基础几何计算库
[Русский (俄语)](intro-rus.md)
[English (英语)](intro-eng.md)
[Deutsch (德语)](intro-deu.md)
**注**:此文本由俄语版本经谷歌机器翻译获得。
## 命名注意事项
C 语言没有命名空间,因此名称中的前缀起到了命名空间的作用。
该库在类型、常量和函数的名称中使用前缀,以避免与其他库发生命名冲突。
### 库前缀(主前缀)
主前缀为 **BGC****B**asic **G**eometric **C**computations 的缩写,可译为“基础几何计算”)。
对于常量和数据结构,前缀为 **BGC_**
例如,结构体:
- BGC_FP64_Vector3
- BGC_FP32_Quaternion
- BGC_FP32_Matrix2x2
常量:
- BGC_FP32_EPSILON
- BGC_FP64_TWO_PI
函数的前缀为 **bgc_**,例如:
- bgc_fp32_turn3_combine
- bgc_fp64_matrix3x3_subtract
### 基本类型前缀(辅助前缀)
库前缀之后是基本类型前缀。
该库使用两种浮点数类型:**float** 和 **double****IEEE 754** 标准的 **binary32****binary64** 类型)。
因此,该库有两个类型前缀:
- **FP32** - 表示 Floating Point 32-bit, 即 32 位浮点数,对应于 C 语言中的 **float** 类型。
- **FP64** - 表示 Floating Point 64-bit即 64 位浮点数,对应于 C 语言中的 **double** 类型。
基于浮点数类型的结构体和常量以 FP32_** 为前缀:
- BGC_FP32_Vector3
- BGC_FP32_Matrix3x2
- BGC_FP32_Quaternion
- BGC_FP32_PI
- BGC_FP32_EPSILON
基于双精度浮点数类型的结构体和常量以 FP64_** 为前缀:
- BGC_FP64_Vector2
- BGC_FP64_Matrix2x3
- BGC_FP64_Turn3
- BGC_FP64_HALF_PI
- BGC_FP64_ONE_THIRD
处理浮点数数据的函数以 **fp32_** 为前缀:
- bgc_fp32_vector2_get_length
- bgc_fp32_radians_to_degrees
处理双精度浮点数数据类型的函数以 **fp64_** 前缀:
- bgc_fp64_vector3_reset
- bgc_fp64_normalize_radians
使用此类前缀可使库在未来扩展以支持新的基本类型。
### 数据类型
- [二维向量](vector2-zho.md)
- [三维向量](vector3-zho.md)
- [四元数](quaternion-zho.md)