From d877b357ea4f94be7b4f19e1fbbf67b65ddff895 Mon Sep 17 00:00:00 2001 From: fan Date: Thu, 13 Jul 2023 16:18:15 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E5=A2=9E=E5=8A=A0=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=96=B9=E6=B3=95"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit dd429849dc2ba010b293f58f4980043eba4a6ec6. --- src/jlgraphic/utils/GraphicUtils.ts | 31 ----------------------------- 1 file changed, 31 deletions(-) diff --git a/src/jlgraphic/utils/GraphicUtils.ts b/src/jlgraphic/utils/GraphicUtils.ts index 9023ff9..362935e 100644 --- a/src/jlgraphic/utils/GraphicUtils.ts +++ b/src/jlgraphic/utils/GraphicUtils.ts @@ -517,34 +517,3 @@ export function angleOfIncludedAngle( } return angle; } -/** - * 判断点是否在线段上 - * @param point 判断点 - * @param start 线段起点 - * @param end 线段终点 - * @returns - */ -export function isPointOnLineSegment( - point: IPointData, - start: IPointData, - end: IPointData -) { - // 计算向量AB和向量AC的叉积 - const crossProduct = - (end.y - start.y) * (point.x - start.x) - - (end.x - start.x) * (point.y - start.y); - - // 如果叉积为0,则点在直线上 - if (crossProduct === 0) { - // 接下来判断点是否在线段上 - if ( - point.x >= Math.min(start.x, end.x) && - point.x <= Math.max(start.x, end.x) && - point.y >= Math.min(start.y, end.y) && - point.y <= Math.max(start.y, end.y) - ) { - return true; // 点在线段上 - } - } - return false; // 点不在线段上 -}