|
|
|
@ -38,8 +38,7 @@ function calcRectangleFromPoints(points) {
|
|
|
|
const bottomAngleRad = Math.atan2(p1.y - p4.y, p1.x - p4.x);
|
|
|
|
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 leftAngleRad = Math.atan2(p1.x - p2.x, p1.y - p2.y);
|
|
|
|
const angleDeg = bottomAngleRad * 180 / Math.PI;
|
|
|
|
const angleDeg = bottomAngleRad * 180 / Math.PI;
|
|
|
|
console.log(leftAngleRad * 180 / Math.PI;
|
|
|
|
console.log(leftAngleRad * 180 / Math.PI)
|
|
|
|
)
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
width: Number(width.toFixed(2)), height: Number(height.toFixed(2)), angle: Number(angleDeg.toFixed(6))
|
|
|
|
width: Number(width.toFixed(2)), height: Number(height.toFixed(2)), angle: Number(angleDeg.toFixed(6))
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|