Calculate angles between points

angle.gh (53.4 KB)

I have a problem getting the angles between each two points correctly. XZ seems to work fine. But YZ fails. I expect around 10 degrees but get 30 on the most extreme angle. The model is clearly not that. I have made simples models to see if I have to project points into flat planes, but those tests suggest that my solution should work, but no it does not. Pointers please. The code generated with these angles looks like the blue picture, where the arrows do not point towards the next arrow in YZ plane.

You can use Relative Item to adjust the data structure of points to achieve the correct calculation results, and fyi.

RelativeItem.gh (49.6 KB)

Thanks for that! Did not know it existed. I am going to take this function and implement several places where I shift lists as a simpler function.

BUT it does not fix the wrong calculations. The vector display is correct as it shows. But the numbers are wrong. It is 0 degree when the vector is in z direction but the further I tilt the worse the error. Maximum tilt in the extreme edges are around 10 degrees, while the calculation are off by 20 or so.

I don’t understand, the maximum tilt in the YZ plane is around 30° - GH and Rhino agree

And it’s nearly zero when nearly vertical

You do have some vectors pointing very slightly in the -ve Y direction which means you get angles of ~359° - those can be tested for and converted to a negative number if you care. But I don’t see any inaccuracies in the measurement.

Ok. Thanks a lot for this! Yes I can see that you are correct. I am unable to get correct movement on my robodk simulation and will ask them why this translation movement is so off in one direction and spot on in the other.