我有一个称为Placement_springs的34 * 3参考矩阵,其第三列填充了不同的角度。 我想在第三列上创建另一个具有角度的矩阵。对于每个单元,我都有一个精确的角度。但是,我想将此第三列更改为与第一矩阵的第三列最接近的值:我该怎么做? 这就是我现在所拥有的:
separation_springs = np.zeros((springs, 3))
j = 0
Theta_initial = 360/springs
increment = Theta_initial
for j in range(springs):
while Theta_initial < 361:
separation_springs[j, 0] = H
separation_springs[j, 1] = R
separation_springs[j, 2] = Theta_initial
Theta_initial = Theta_initial + increment
j = j + 1
# So I have the initial values of the angles. Now I want to apply each one to a reference value
m = 0
while m < 34:
if placement_springs[m, 2] - 3 < separation_springs[j, 2] < placement_springs[m, 2] + 3:
separation_springs[j, 2] == placement_springs[m, 2]
else:
m = m + 1