From f6d7dbd2ac6938526b1023d1bc571d562b4625cf Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期四, 17 九月 2020 15:16:51 +0800 Subject: [PATCH] minditance --- algorithm/include/graph.h | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/algorithm/include/graph.h b/algorithm/include/graph.h index 4d35724..9c5682b 100644 --- a/algorithm/include/graph.h +++ b/algorithm/include/graph.h @@ -2,6 +2,7 @@ #define __USG_GRAPH_H__ #include "usg_common.h" +#include <cmath> struct Point { //public: @@ -62,4 +63,10 @@ return {b.x - a.x, b.y - a.y}; } +static inline double getVecor2Len(Vector2& v) { + return sqrt(v.x * v.x + v.y * v.y); +} + + + #endif -- Gitblit v1.8.0