数学类添加两个方法 判断点是否在多个矩形中 一个方法返回是或否 一个方法返回在哪个矩形中

This commit is contained in:
Lenheart 2024-12-25 11:30:29 +08:00
parent 55847baa36
commit 04c6992840
1 changed files with 12 additions and 2 deletions

View File

@ -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;