<commit_before>#ifndef _SPATIAL_MATH_PLANE_INL_
#define _SPATIAL_MATH_PLANE_INL_

namespace sm
{

template <typename T>
inline PlaneT<T>::PlaneT(const Vector3<T>& n, T d)
	: normal(n)
{
	Build(n, d);
}

template <typename T>
inline PlaneT<T>::PlaneT(const Vector3<T>& normal, const Vector3<T>& v0)
{
	Build(normal, v0);
}

template <typename T>
inline PlaneT<T>::PlaneT(const Vector3<T>& v0, const Vector3<T>& v1, const Vector3<T>& v2)
{
	Build(v0, v1, v2);
}

template <typename T>
inline T PlaneT<T>::GetDistance(const Vector3<T>& v) const
{
	T d = normal.Dot(v);
	return d - dist;
}

template <typename T>
inline void PlaneT<T>::Build(const Vector3<T>& normal, T d)
{
	T inv_len = 1.0f / normal.Length();
	this->normal = normal * inv_len;
	this->dist = d * inv_len;
}

template <typename T>
inline void PlaneT<T>::Build(const Vector3<T>& normal, const Vector3<T>& v)
{
	this->normal = normal.Normalized();
	this->dist = -v.Dot(normal);
}

template <typename T>
inline void PlaneT<T>::Build(const Vector3<T>& v0, const Vector3<T>& v1, const Vector3<T>& v2)
{
	Vector3<T> a = v1 - v0,
		       b = v2 - v0;
	normal = a.Cross(b);
	normal.Normalize();
	dist = -normal.Dot(v0);
}

}

#endif // _SPATIAL_MATH_PLANE_INL_<commit_msg>[FIXED] calc plane dist<commit_after>#ifndef _SPATIAL_MATH_PLANE_INL_
#define _SPATIAL_MATH_PLANE_INL_

namespace sm
{

template <typename T>
inline PlaneT<T>::PlaneT(const Vector3<T>& n, T d)
	: normal(n)
{
	Build(n, d);
}

template <typename T>
inline PlaneT<T>::PlaneT(const Vector3<T>& normal, const Vector3<T>& v0)
{
	Build(normal, v0);
}

template <typename T>
inline PlaneT<T>::PlaneT(const Vector3<T>& v0, const Vector3<T>& v1, const Vector3<T>& v2)
{
	Build(v0, v1, v2);
}

template <typename T>
inline T PlaneT<T>::GetDistance(const Vector3<T>& v) const
{
	T d = normal.Dot(v);
	return d + dist;
}

template <typename T>
inline void PlaneT<T>::Build(const Vector3<T>& normal, T d)
{
	T inv_len = 1.0f / normal.Length();
	this->normal = normal * inv_len;
	this->dist = d * inv_len;
}

template <typename T>
inline void PlaneT<T>::Build(const Vector3<T>& normal, const Vector3<T>& v)
{
	this->normal = normal.Normalized();
	this->dist = -v.Dot(normal);
}

template <typename T>
inline void PlaneT<T>::Build(const Vector3<T>& v0, const Vector3<T>& v1, const Vector3<T>& v2)
{
	Vector3<T> a = v1 - v0,
		       b = v2 - v0;
	normal = a.Cross(b);
	normal.Normalize();
	dist = -normal.Dot(v0);
}

}

#endif // _SPATIAL_MATH_PLANE_INL_
{'fraction_non_alphanumeric': 0.16707218167072183, 'fraction_numerical': 0.025952960259529603, 'mean_word_length': 4.804705882352941, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2426029', 'n_tokens_mistral': 1055, 'n_tokens_neox': 1041, 'n_words': 250}