[TD] extend Base::Vector3D

This commit is contained in:
edi271
2024-01-11 20:42:36 +01:00
committed by WandererFan
parent 975642964c
commit a01220180f
2 changed files with 23 additions and 0 deletions

View File

@@ -227,6 +227,25 @@ bool Vector3<float_type>::IsEqual(const Vector3<float_type>& rclPnt, float_type
return Distance(*this, rclPnt) <= tol;
}
template<class float_type>
bool Vector3<float_type>::IsParallel(const Vector3<float_type>& rclPnt, float_type tol) const
{
Vector3<float_type> v1 = *this;
Vector3<float_type> v2 = rclPnt;
double dot = abs(v1 * v2);
double mag = v1.Length() * v2.Length();
return (abs(dot - mag) < tol);
}
template<class float_type>
bool Vector3<float_type>::IsNormal(const Vector3<float_type>& rclPnt, float_type tol) const
{
Vector3<float_type> v1 = *this;
Vector3<float_type> v2 = rclPnt;
double dot = abs(v1 * v2);
return (dot < tol);
}
template<class float_type>
Vector3<float_type>& Vector3<float_type>::ProjectToPlane(const Vector3<float_type>& rclBase,
const Vector3<float_type>& rclNorm)