From 1eaf2da087ab028b1b859551605bdf8a32f683e5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 18 Mar 2019 17:40:08 +0800 Subject: [PATCH] add LengthSqr --- a8/sysutils.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/a8/sysutils.h b/a8/sysutils.h index 23f98d0..55fe1f6 100644 --- a/a8/sysutils.h +++ b/a8/sysutils.h @@ -48,6 +48,12 @@ namespace a8 return v < hi ? (v > lo ? v : lo) : hi; } + template + const T& LengthSqr(const T& v) + { + return v.x * v.x + v.y * v.y; + } + template void SetToVector(std::set& set_v, std::vector& vector_v) {