Add of some mathematical functions
Plane: Getters and classic planes Sphere: Getter Vector2: Angle between two vectors Vector3: Same in 3D Former-commit-id: 07e6421def813743e5fd8248fe2e9503cebbb8a8
This commit is contained in:
@@ -54,6 +54,15 @@ inline unsigned int NzVector2<unsigned int>::AbsDotProduct(const NzVector2<unsig
|
||||
return std::labs(x * vec.x) + std::labs(y * vec.y);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T NzVector2<T>::AngleBetween(const NzVector2& vec, bool toDegree) const
|
||||
{
|
||||
if (toDegree)
|
||||
return NzRadianToDegree(std::atan2(vec.y, vec.x) - std::atan2(y, x));
|
||||
else
|
||||
return std::atan2(vec.y, vec.x) - std::atan2(y, x);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T NzVector2<T>::Distance(const NzVector2& vec) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user