Продолжение переименования типов и функций
This commit is contained in:
parent
605afabd94
commit
3b6efaafa9
25 changed files with 768 additions and 916 deletions
|
@ -2,25 +2,25 @@
|
|||
|
||||
// =================== Angle ==================== //
|
||||
|
||||
float fp32_vector2_get_angle(const fp32_vector2_t* vector1, const fp32_vector2_t* vector2, const angle_unit_t unit)
|
||||
float vector2_fp32_get_angle(const vector2_fp32_t* vector1, const vector2_fp32_t* vector2, const angle_unit_t unit)
|
||||
{
|
||||
if (vector1 == 0 || vector2 == 0) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
const float square_modulus1 = fp32_vector2_get_square_modulus(vector1);
|
||||
const float square_modulus1 = vector2_get_square_modulus_fp32(vector1);
|
||||
|
||||
if (square_modulus1 <= FP32_SQUARE_EPSYLON) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
const float square_modulus2 = fp32_vector2_get_square_modulus(vector2);
|
||||
const float square_modulus2 = vector2_get_square_modulus_fp32(vector2);
|
||||
|
||||
if (square_modulus2 <= FP32_SQUARE_EPSYLON) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
const float cosine = fp32_vector2_scalar_product(vector1, vector2) / sqrtf(square_modulus1 * square_modulus2);
|
||||
const float cosine = vector2_fp32_scalar_product(vector1, vector2) / sqrtf(square_modulus1 * square_modulus2);
|
||||
|
||||
if (cosine >= 1.0f - FP32_EPSYLON) {
|
||||
return 0.0f;
|
||||
|
@ -33,25 +33,25 @@ float fp32_vector2_get_angle(const fp32_vector2_t* vector1, const fp32_vector2_t
|
|||
return fp32_radians_to_units(acosf(cosine), unit);
|
||||
}
|
||||
|
||||
double fp64_vector2_get_angle(const fp64_vector2_t* vector1, const fp64_vector2_t* vector2, const angle_unit_t unit)
|
||||
double vector2_fp64_get_angle(const vector2_fp64_t* vector1, const vector2_fp64_t* vector2, const angle_unit_t unit)
|
||||
{
|
||||
if (vector1 == 0 || vector2 == 0) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
const double square_modulus1 = fp64_vector2_get_square_modulus(vector1);
|
||||
const double square_modulus1 = vector2_get_square_modulus_fp64(vector1);
|
||||
|
||||
if (square_modulus1 <= FP64_SQUARE_EPSYLON) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
const double square_modulus2 = fp64_vector2_get_square_modulus(vector2);
|
||||
const double square_modulus2 = vector2_get_square_modulus_fp64(vector2);
|
||||
|
||||
if (square_modulus2 <= FP64_SQUARE_EPSYLON) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
const double cosine = fp64_vector2_scalar_product(vector1, vector2) / sqrt(square_modulus1 * square_modulus2);
|
||||
const double cosine = vector2_fp64_scalar_product(vector1, vector2) / sqrt(square_modulus1 * square_modulus2);
|
||||
|
||||
if (cosine >= 1.0 - FP64_EPSYLON) {
|
||||
return 0.0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue