add LengthSqr

This commit is contained in:
aozhiwei 2019-03-18 17:40:08 +08:00
parent 128aab9252
commit 1eaf2da087

View File

@ -48,6 +48,12 @@ namespace a8
return v < hi ? (v > lo ? v : lo) : hi;
}
template <typename T>
const T& LengthSqr(const T& v)
{
return v.x * v.x + v.y * v.y;
}
template <typename T>
void SetToVector(std::set<T>& set_v, std::vector<T>& vector_v)
{