add somewhere that the function works only if all the angles are provided. Not sure what will happen if any of the values is null for example.