From 78106912a9e80c1ace5533615cab0bd4a00657a0 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Wed, 31 Jan 2024 10:36:40 +0100 Subject: [PATCH] renames spherical magnitude to distance --- Spherical.cpp | 10 +++++----- Spherical.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Spherical.cpp b/Spherical.cpp index 9d078b9..026d33b 100644 --- a/Spherical.cpp +++ b/Spherical.cpp @@ -9,7 +9,7 @@ Spherical::Spherical() { this->horizontalAngle = 0; this->verticalAngle = 0; - this->magnitude = 0; + this->distance = 0; } // Spherical::Spherical(float polarAngle, float elevationAngle, float distance) @@ -22,11 +22,11 @@ Spherical::Spherical() { Spherical::Spherical(Polar polar) { this->horizontalAngle = polar.angle; this->verticalAngle = 0.0F; - this->magnitude = polar.distance; + this->distance = polar.distance; } Spherical::Spherical(float distance, Angle horizontalAngle, Angle verticalAngle) - : magnitude(distance), horizontalAngle(horizontalAngle), + : distance(distance), horizontalAngle(horizontalAngle), verticalAngle(verticalAngle) {} Spherical::Spherical(Vector3 v) { @@ -34,7 +34,7 @@ Spherical::Spherical(Vector3 v) { horizontalAngle = atan2(v.y, signZ * sqrt(v.z * v.z + v.x * v.x)) * Angle::Rad2Deg; verticalAngle = -atan2(v.x, sqrt(v.z * v.z + v.y * v.y)) * Angle::Rad2Deg; - magnitude = v.magnitude(); + distance = v.magnitude(); } const Spherical Spherical::zero = Spherical(0.0F, (Angle)0.0F, (Angle)0.0F); @@ -46,5 +46,5 @@ float Spherical::GetSwing() { } Polar Spherical::ProjectOnHorizontalPlane() { - Polar(horizontalAngle, magnitude); + return Polar(horizontalAngle, distance); } \ No newline at end of file diff --git a/Spherical.h b/Spherical.h index 25c9e2f..7c98263 100644 --- a/Spherical.h +++ b/Spherical.h @@ -21,7 +21,7 @@ namespace Passer { /// as a forward direction. struct Spherical { public: - float magnitude; + float distance; /// @brief The angle in the horizontal plane in degrees, clockwise rotation /// @details The angle is automatically normalized to -180 .. 180