Add distance between
This commit is contained in:
parent
6a1d0434cf
commit
05c61a3dbd
@ -208,6 +208,13 @@ SphericalOf<T> SphericalOf<T>::operator/=(float f) {
|
|||||||
|
|
||||||
const float epsilon = 1E-05f;
|
const float epsilon = 1E-05f;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
float SphericalOf<T>::DistanceBetween(const SphericalOf<T>& v1,
|
||||||
|
const SphericalOf<T>& v2) {
|
||||||
|
SphericalOf<T> difference = v1 - v2;
|
||||||
|
return difference.distance;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
AngleOf<T> SphericalOf<T>::AngleBetween(const SphericalOf& v1,
|
AngleOf<T> SphericalOf<T>::AngleBetween(const SphericalOf& v1,
|
||||||
const SphericalOf& v2) {
|
const SphericalOf& v2) {
|
||||||
|
@ -103,6 +103,8 @@ class SphericalOf {
|
|||||||
/// <returns>The distance between the two vectors</returns>
|
/// <returns>The distance between the two vectors</returns>
|
||||||
// static float Distance(const Spherical &s1, const Spherical &s2);
|
// static float Distance(const Spherical &s1, const Spherical &s2);
|
||||||
|
|
||||||
|
static float DistanceBetween(const SphericalOf<T>& v1,
|
||||||
|
const SphericalOf<T>& v2);
|
||||||
static AngleOf<T> AngleBetween(const SphericalOf<T>& v1,
|
static AngleOf<T> AngleBetween(const SphericalOf<T>& v1,
|
||||||
const SphericalOf<T>& v2);
|
const SphericalOf<T>& v2);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user