Finished trig function.