-
calculate tangent (.NET)
I am trying to figure out the azymuth betwen two points using the following
azymuth = 90 - (tanE-1(DeltaN/DeltaE)
i have been given the answer of 87.7930 when the delatN is 10 and the DeltaE is 259.58 but i have no idea how to get the answer.
System.Math.Tan(10/259.58) and i get 0.03854283 when the anwer should be 2.2062
I know tan is to be raised to the neg1 exponent, is that implied in the tangent function?I can't evn get my calculato to come up with the right answer.
Help!
Thanks
Completely lost in trig
-
Not sure what you mean because your english isn't all that great :P so the following is just stuff that having read your post I think you might like to know.
In degrees:
tan(10/259.58) = tan(0.03852376...) = 6.72E-4
In radians:
tan(10/259.58) = tan(0.03852376...) = 0.03854283...
If x = tan(y) then y = tan-1(x), i.e. y is the angle whose tangent is x.
tan-1(y) != (is NOT equal to) 1/tan(y)
System.Math.Tan(double d) calculates the tangent of d, where d is measured in radians.
What you've done is used tan(0.03852376...) rather than tan-1(0.03852376...). Bear in mind the above statement about the inverse tangent function.
System.Math.ATan(double y, double x) is the function you want to be using, where y = deltaN and x = deltaE (ATan being short for arctan which is another way of saying tan-1).
In fact, you (can) know that using either tan(x) or 1/tan(x) is wrong. The tangent of an angle represents a ratio (to do with sides of triangles), i.e. tan(x) is unitless, and therefore so is 1/tan(x). Your formula for azymuth (azimuth? whatever) takes something from 90, presumable 90o because you're talking trigonometry. It doesn't make any practical sense taking (or adding) a unitless number from a number with a unit, that would be like saying "what's $4.30 + 3.8kg?". It would make sense if the something was in degrees because then the units would agree. If tan-1(y) gives you the angle whose tangent is y, which can be in degrees, then it seems sensible to assume that that's what you meant.
Indeed if you do recognize that and put the numbers in you get 89.738...o which is pretty damn close to the answer given (although the third decimal place in yours is incorrect).
I apologize if you already knew all/most of that but I thought I'd post it anyways, it's not going to do any harm...