Use trigonometric identities (#471)

Use trigonometric identities (#471)

Tan and pythagorean