From c22db40b173cc7e4ce0488120f76530d4b17740e Mon Sep 17 00:00:00 2001 From: suixy <2277317060@qq.com> Date: Thu, 16 Apr 2026 16:58:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=92=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/tool.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/tool.js b/src/utils/tool.js index d2c0b7e..8c2e603 100644 --- a/src/utils/tool.js +++ b/src/utils/tool.js @@ -36,7 +36,10 @@ function calcRectangleFromPoints(points) { const height = trapezoid ? (left + right) / 2 : right; const bottomAngleRad = Math.atan2(p1.y - p4.y, p1.x - p4.x); + const leftAngleRad = Math.atan2(p1.x - p2.x, p1.y - p2.y); const angleDeg = bottomAngleRad * 180 / Math.PI; + console.log(leftAngleRad * 180 / Math.PI; +) return { width: Number(width.toFixed(2)), height: Number(height.toFixed(2)), angle: Number(angleDeg.toFixed(6)) }; @@ -62,7 +65,6 @@ function getLocalPositionRelativeToP4(point, rectPoints, rectInfo) { const y_local = dx * Math.sin(rad) + dy * Math.cos(rad); const rotate_local = ((point.rotate ?? 0) + rectInfo.angle + 360) % 360; - console.log(rotate_local) return { x: Number(x_local.toFixed(2)), y: Number(y_local.toFixed(2)), rotate: Number(rotate_local.toFixed(2)) };