How do I do secant calculation in Processing?

I am trying to calculate the angle of a terminal angle in a circle. The line is a normalized vector that follows the mouse. Is there a way to use secant in Processing so I can do this? Or is there any other way to do this?

Answers

  • Answer ✓

    In addition to sine, cosine, and tangent, there are three other trigonometric functions you need to know for the Math IIC: cosecant, secant, and cotangent. These functions are simply the reciprocals of sine, cosine, and tangent. Cotangent is the reciprocal of tangent.

    So for secant, you should be able to do:

    float theta=PI/3.0;               /// or 60 degrees
    float value = 1.0/cos(theta);
    

    Kf

Sign In or Register to comment.