From 04c69928408939a24faffd6bc86ff9faa3a07a35 Mon Sep 17 00:00:00 2001 From: Lenheart <947330670@qq.com> Date: Wed, 25 Dec 2024 11:30:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E5=AD=A6=E7=B1=BB=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E6=96=B9=E6=B3=95=20=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E7=82=B9=E6=98=AF=E5=90=A6=E5=9C=A8=E5=A4=9A=E4=B8=AA=E7=9F=A9?= =?UTF-8?q?=E5=BD=A2=E4=B8=AD=20=20=E4=B8=80=E4=B8=AA=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=98=AF=E6=88=96=E5=90=A6=20=20=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=96=B9=E6=B3=95=E8=BF=94=E5=9B=9E=E5=9C=A8=E5=93=AA?= =?UTF-8?q?=E4=B8=AA=E7=9F=A9=E5=BD=A2=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sqr/Core/BaseTool/Math.nut | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sqr/Core/BaseTool/Math.nut b/sqr/Core/BaseTool/Math.nut index d6df687..87cea15 100644 --- a/sqr/Core/BaseTool/Math.nut +++ b/sqr/Core/BaseTool/Math.nut @@ -252,6 +252,16 @@ class Math { } + //判断一个点是否存在于一个矩形中 + function PointIsInSquare(x1, y1, SquareArr) { + return Sq_Is_Point_In_Square(x1, y1, SquareArr); + } + + //判断一个点是否存在于一个矩形中 返回是哪一个矩形 + function PointIsInWhichRectangle(x1, y1, SquareArr) { + return Sq_Is_Point_In_WhichRectangle(x1, y1, SquareArr); + } + //获得给定4个点形成的四边形面积 function get4PointArea(x1, y1, x2, y2, x3, y3, x4, y4) { @@ -336,14 +346,14 @@ class Math { } - function getMax(a, b) { + function Max(a, b) { if (a< b) return b; return a; } - function getMin(a, b) { + function Min(a, b) { if (a > b) return b; return a;