Got the arctan to work, but still getting incorrect results for sin and cos