get more accurate

This commit is contained in:
2024-09-07 16:47:14 +08:00
parent 4c409ace18
commit 095f63d154
7 changed files with 15 additions and 15 deletions

View File

@@ -11,7 +11,7 @@ import multiprocessing
import io
from PIL import Image
mp.dps = 15 # 设置精度为15位小数
mp.dps = 50 # 设置精度为50位小数
kSegLength1 = mp.mpf('2.86')
kSegLength2 = mp.mpf('1.65')
@@ -37,7 +37,7 @@ class Dragon:
test_node_dot = self.Theta2Dot(theta)
actual_distance = mp.sqrt((cur_node_dot[0]-test_node_dot[0])**2 + (cur_node_dot[1]-test_node_dot[1])**2)
return actual_distance - expected_distance
return mp.findroot(f, cur_node_theta + 0.1, solver='secant',tol=1e-20)
return mp.findroot(f, cur_node_theta + 0.1, solver='secant')
def CalcMoveList(self, delta_theta=0):