As the title says, I'm confused on what tan and atan are. I'm writing a program in Java and I came across these two mathematical functions. I know tan stands for tangent but if possible could someone please explain this to me. I have not taken triginomotry yet (I've taken up to Algebra 1) so I don't really need a very in depth explanation since i wouldnt understand but just a simple one so i could move on with my program would be great! Thanks in advanced. Also if possible could someone possibly give me a link to an image/example of a tangent and atan.
$\endgroup$ 53 Answers
$\begingroup$A quick google search of "java atan" would tell you that it stands for "arctangent", which is the inverse of tangent. Tangent is first understood as a ratio of non-hypotenuse sides of a right triangle. Given a non-right angle $x$ of a right triangle, $\tan(x)$ is the ratio $\frac{o}{a}$ where $o$ is the length of the leg of the triangle opposite $x$ and $a$ is the length of the leg adjacent to $x$. Arctangent takes the ratio as an input and returns the angle.
I don't think any single answer to your post will give you a complete understanding of tangent and arctangent. To get that, I recommend spending some time with sine, cosine, tangent and the unit circle. Here is a link to an image that uses an angle $A$ and triangle sides $a,o,h$. In the context of that photo, $\arctan\left(\frac{\text{opposite}}{\text{adjacent}}\right) = A$
$\endgroup$ 2 $\begingroup$I think the following picture is useful [from Wikipedia]:
The tangent of a number $0<\theta<\pi/2$ is constructed by
- taking a circle of radius 1, centered at the origin
- drawing the tangent at the point on positive $x$-axis
- drawing the line (ray) at an angle of $\theta$ from the origin
- constructing the intersection of these two lines
- measuring the distance between the intersection and the positive $x$-axis.
The final distance is the tangent of $\theta$, denoted $\tan\theta$.
As others have mentioned, the arctangent of a number $0<d<\infty$ is the number $\theta$ for which $\tan\theta=d$. In other words, it is the angle for which, after performing the described procedure above, you get a distance of $d$. It is denoted in many ways, including atan $\theta$, arctan $\theta$, and $\tan^{-1}\theta$.
Note that I've only defined $\tan\theta$ for a limited collection of $\theta$: to get other values, you can use the identities $\tan(-\theta)=-\tan(\theta)$ and $\tan(\pi+\theta)=\tan\theta$. So for instance, if you knew that $\tan(\pi/4)=1$, then you would also know that
$$\tan\left(-\frac{7\pi}{4}\right) =-\tan\left(\frac{7\pi}{4}\right) =-\tan\left(\frac{3\pi}{4}\right) =-\tan\left(-\frac{\pi}{4}\right) =\tan\left(\frac{\pi}{4}\right) =1$$
From these facts you can also derive the rest of the arctangent values: it turns out that atan $-d$ = $-$atan $d$.
(This is not entirely true: the arctangent is technically a multivalued function, so you have to make some arbitrary choice of how to extend it to negative numbers. But the choice above is the most common one.)
$\endgroup$ 2 $\begingroup$atan stands for "arc tangent." It is the inverse function of tangent - this means it undoes the tangent function. So atan(tan(30)) = 30.
$\endgroup$ 2