i am currently trying to rotate four points to match their Position to an other set of four Points. I do this with a 3D Rotation Matrix. But i get the following issue:
The distance between the points change after the rotation and i do not understand why.
squared_dist = np.sum((tarll-tarul)**2, axis=0)
dist2 = np.sqrt(squared_dist)
print(dist2)
theta = -0.46
tarlr[0] = tarlr[0] * math.cos(theta) - tarlr[1] * math.sin(theta)
tarlr[1] = tarlr[0] * math.sin(theta) + tarlr[1] * math.cos(theta)
tarlr[2] = tarlr[2]
tarll[0] = tarll[0] * math.cos(theta) - tarll[1] * math.sin(theta)
tarll[1] = tarll[0] * math.sin(theta) + tarll[1] * math.cos(theta)
tarll[2] = tarll[2]
tarur[0] = tarur[0] * math.cos(theta) - tarur[1] * math.sin(theta)
tarur[1] = tarur[0] * math.sin(theta) + tarur[1] * math.cos(theta)
tarur[2] = tarur[2]
tarul[0] = tarul[0] * math.cos(theta) - tarul[1] * math.sin(theta)
tarul[1] = tarul[0] * math.sin(theta) + tarul[1] * math.cos(theta)
tarul[2] = tarul[2]
squared_dist = np.sum((tarll-tarul)**2, axis=0)
dist3 = np.sqrt(squared_dist)
print(dist3)
The points are:
#Tar position
tarlr = np.array([2.5679,3.5465,3.9583])
tarur = np.array([5.0263,-0.3365,3.9411])
tarul = np.array([1.1462,-2.7898,3.9491])
tarll = np.array([-1.3130,1.0835,3.9638])
#old Parameter
tarllOld = np.array([-2.4708,2.3395,4.101])
tarlrOld = np.array([2.1218,2.5116,4.0952])
tarurOld = np.array([2.2889,-2.0805,4.0774])
tarulOld = np.array([-2.2992,-2.2462,4.0859])