数学类添加两个方法 判断点是否在多个矩形中 一个方法返回是或否 一个方法返回在哪个矩形中
This commit is contained in:
parent
55847baa36
commit
04c6992840
|
|
@ -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个点形成的四边形面积
|
//获得给定4个点形成的四边形面积
|
||||||
function get4PointArea(x1, y1, x2, y2, x3, y3, x4, y4) {
|
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)
|
if (a< b)
|
||||||
return b;
|
return b;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getMin(a, b) {
|
function Min(a, b) {
|
||||||
if (a > b)
|
if (a > b)
|
||||||
return b;
|
return b;
|
||||||
return a;
|
return a;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue