: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: "William Markham" <William.Markham@p...>
: Subject: [sql_language] Case Statements And Tangents
:
:
: : First: The TAN function.
: : I am trying to transform a typical coordinate system into headings
: : with -y being the 0/360 degree mark. Is there a way to make the TAN
: : function work with angle over 180 degrees
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:
: Have you looked in a maths text? Tan gives you the
: ratio of the opposite side to the adjacent side of a right angle
: triangle. Tan(180) should give you infinity, since the opposite
: hypotenuse, and the adjacent side has a length of 0. Try drawing
: this triangle on a piece of paper and you'll see what I mean.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I should probably clarify what I mean here (and correct myself). Tan(180)
gives you both positive and negative infinity.
You can also get the Tan(x) where x > 180. What you need to bear in mind is
that the values that Tan(x) returns varies from negative infinity to
positive infinity as you move from -180 deg to +180 deg, then the cycle
starts again.
If you are having problems with whatever code you have (which you haven't
given), you might want to change your x value to a value between -180 and
180 by subtracting 360 deg until the value is between -180 and 180, then
calculating the tan(), as the value will be the same.
Cheers
Ken