Use trigonometric identities (#471)