Suggestions for atoms.set_angle() method

I’m not entirely sure if this has been reported before, but using the set_angle() method on linear triatomic molecules seems return a norm(v)==0 division by zero error.

Currently what I do is move the position of one of the molecules by a certain amount along a coordinate and then set the angle as now it is no longer linear.

I just wish there was a way this method could check if the molecule is linear first and then appropriately find an alternate way to set the angle?

Apologies if my suggestions are not very helpful but this is a feature I hope to be fixed.

Hi cs_s,

Suppose you have atoms at [-1, 0, +1] along the z axis.

Now you set the angle to 80 degrees. Where should the atoms go?

Best regards
Ask

Hmm, good question. I am not entirely sure. However, this problem is actually more trivial than I thought, and was able to write a simple function for it!

Either way, it’s on purpose that the code raises an error. When there are multiple solutions to a problem, it is safer to raise an error than to choose an arbitrary one.