From 396123603febc184ac16d2a28ae72a2df716d776 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期二, 10 九月 2024 16:24:50 +0800
Subject: [PATCH] #fs

---
 src/main/java/com/zy/asrs/controller/RgvController.java |    4 ++--
 src/main/java/com/zy/asrs/utils/Utils.java              |   22 ++++++++++++++++++++++
 src/main/webapp/views/index.html                        |    2 +-
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/RgvController.java b/src/main/java/com/zy/asrs/controller/RgvController.java
index b4c4559..a13e3e2 100644
--- a/src/main/java/com/zy/asrs/controller/RgvController.java
+++ b/src/main/java/com/zy/asrs/controller/RgvController.java
@@ -359,7 +359,7 @@
 
 //            ringThroughParam.setIndex(rgv.getId());
             ringThroughParam.setIndex(i);
-            double[] doubles = Utils.RingThroughXY(183.0, 100.0*i);
+            double[] doubles = Utils.RingThroughXY2(183.0, 100.0*i);
             ringThroughParam.setValueX(doubles[0]);
             ringThroughParam.setValueY(doubles[1]);
             result.add(ringThroughParam);
@@ -386,7 +386,7 @@
 
 //            ringThroughParam.setIndex(rgv.getId());
             ringThroughParam.setIndex(i);
-            double[] doubles = Utils.RingThroughXY(183.0, 103.0*i);
+            double[] doubles = Utils.RingThroughXY2(183.0, 100.0*i);
             ringThroughParam.setValueX(doubles[0]);
             ringThroughParam.setValueY(doubles[1]);
             result.add(ringThroughParam);
diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
index 252823e..97f92b1 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -87,5 +87,27 @@
         return new double[]{x,y};
     }
 
+    public static double[] RingThroughXY2(double a,double b) {
+        double l = b / a;
+
+        // 鍦嗙殑宸茬煡鍙傛暟
+        double radius = 48; // 鍗婂緞涓�48
+//        double circumference = ; // 璁$畻鍦嗗懆闀�
+        double arcLength = 2 * Math.PI * radius * l; // 缁欏嚭鐨勫姬闀�
+
+        // 鍦嗗績鍧愭爣
+        double centerX = 51;
+        double centerY = 49;
+
+        // 姹傚姬搴�
+        double theta = arcLength / radius;
+
+        // 璁$畻鐐圭殑鍧愭爣
+        double x = 100-(centerX + radius * Math.cos(theta));
+        double y = centerY + radius * Math.sin(theta);
+
+        return new double[]{x, y};
+    }
+
 
 }
diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html
index ebd24eb..af06e79 100644
--- a/src/main/webapp/views/index.html
+++ b/src/main/webapp/views/index.html
@@ -86,7 +86,7 @@
         <div class="outer-ring"></div>
 
         <!-- Stations on outer ring -->
-<!--        <div class="station" style="top: -10px; left: 50%;">1</div>-->
+<!--        <div class="station" style="top: 49%; left: 99%;">1000</div>-->
 <!--        <div class="station" style="top: 30%; left: 100%;">2</div>-->
 <!--        <div class="station" style="top: 70%; left: 100%;">3</div>-->
 <!--        <div class="station" style="top: 110%; left: 50%;">4</div>-->

--
Gitblit v1.9.1