Tangent Calculator — tan(x) in Degrees or Radians
tan(x)
--
Angle in Degrees
--
Angle in Radians
--
How the Tangent Function Works
The tangent function is one of the six fundamental trigonometric functions, defined as the ratio of the sine to the cosine: tan(x) = sin(x) / cos(x). Equivalently, in a right triangle, tangent equals the length of the side opposite the angle divided by the length of the adjacent side. Unlike sine and cosine, which are bounded between -1 and 1, the tangent function has no maximum or minimum value and ranges from negative infinity to positive infinity. According to the Mathematical Association of America, the tangent function was first tabulated by Islamic mathematicians in the 9th century and was called "the shadow" because of its relationship to sundial calculations.
The tangent function has vertical asymptotes at odd multiples of 90 degrees (or π/2 radians), where the cosine equals zero and the ratio becomes undefined. Between these asymptotes, tangent increases monotonically from negative infinity to positive infinity. The function has a period of 180 degrees (π radians), which is half the period of sine and cosine. This periodicity means tan(x + 180) = tan(x) for all defined values. Tangent is widely used in engineering for calculating slopes and grades, in navigation for bearing calculations, and in physics for analyzing projectile trajectories. For complementary trig functions, see our sine calculator and cosine calculator.
The Tangent Formula
tan(θ) = opposite / adjacent = sin(θ) / cos(θ)
Worked example: tan(30°) = sin(30°) / cos(30°) = 0.5 / 0.866 = 0.5774. This equals 1/√3, one of the exact trigonometric values. In a right triangle with a 30° angle and adjacent side of 10 meters, the opposite side = 10 × tan(30°) = 5.774 meters. The inverse function arctan(0.5774) = 30° recovers the original angle.
Key Terms
- Tangent (tan): The ratio of opposite to adjacent side in a right triangle, or sin/cos. Ranges from -∞ to +∞.
- Asymptote: A vertical line where the function approaches infinity. Tangent has asymptotes at 90°, 270°, -90°, etc.
- Period: The interval after which the function repeats. For tangent, the period is 180° (π radians).
- Inverse Tangent (arctan): The function that returns the angle whose tangent is a given value. Output range: -90° to 90°.
- Radian: An angle measure where 2π radians = 360°. One radian ≈ 57.296°.
Common Tangent Values Reference Table
| Degrees | Radians | tan(x) | Exact Value |
|---|---|---|---|
| 0° | 0 | 0 | 0 |
| 30° | π/6 | 0.5774 | 1/√3 |
| 45° | π/4 | 1.0000 | 1 |
| 60° | π/3 | 1.7321 | √3 |
| 90° | π/2 | Undefined | Asymptote |
| 135° | 3π/4 | -1.0000 | -1 |
Practical Examples
Example 1 -- Building a ramp: A wheelchair ramp must rise 3 feet over a horizontal distance of 36 feet. The angle of inclination = arctan(3/36) = arctan(0.0833) = 4.76°. This meets ADA requirements of no more than a 1:12 slope (4.76°). Use the right triangle calculator for related problems.
Example 2 -- Surveying a building height: Standing 50 meters from a building, you measure the angle of elevation to the top as 62°. Height = 50 × tan(62°) = 50 × 1.8807 = 94.04 meters above eye level.
Example 3 -- Road grade: A road sign shows a 6% grade. The angle = arctan(0.06) = 3.43°. For every 100 meters of horizontal distance, the road rises 6 meters.
Tips and Strategies
- Remember key values: tan(0°) = 0, tan(45°) = 1, tan(60°) = √3 ≈ 1.732. These appear frequently in exams and engineering calculations.
- Watch for undefined values: Tangent is undefined at 90°, 270°, etc. If your calculator shows an error or very large number near these angles, the result is approaching an asymptote.
- Convert between degrees and radians: Multiply degrees by π/180 to get radians. Many programming languages and scientific calculators default to radians.
- Use tangent for slopes: The tangent of an angle equals the slope of a line at that angle. A 45° line has slope = tan(45°) = 1.
- Inverse tangent range: arctan always returns values between -90° and 90°. For angles in other quadrants, adjust based on the signs of x and y coordinates.
Frequently Asked Questions
When is tangent undefined?
Tangent is undefined at 90°, 270°, 450°, and all odd multiples of 90° (or π/2 radians). At these angles, the cosine equals zero, making the sin/cos ratio undefined. Graphically, these are vertical asymptotes where the tangent curve shoots toward positive or negative infinity. As you approach 90° from the left, tangent increases toward positive infinity; from the right, it decreases from negative infinity. In practical calculations, if your angle is very close to an asymptote, the result will be an extremely large positive or negative number rather than a meaningful value.
What is tan(45)?
tan(45°) equals exactly 1. This is because at 45 degrees, the opposite and adjacent sides of a right triangle are equal, making their ratio exactly 1. In fact, 45° is the only angle between 0° and 90° where tangent equals 1. This value is frequently used in engineering and construction: a 45° slope has a rise equal to its run, which corresponds to a 100% grade. The 45-45-90 triangle (isosceles right triangle) is one of the two special right triangles commonly memorized in trigonometry.
Is tangent periodic?
Yes, the tangent function has a period of 180° (π radians), meaning tan(x + 180°) = tan(x) for all x where tangent is defined. This is half the period of sine and cosine, which repeat every 360°. The shorter period occurs because tangent's sign pattern (positive in quadrants I and III, negative in II and IV) repeats every two quadrants. Between consecutive asymptotes, tangent completes one full cycle from negative infinity to positive infinity, creating its characteristic S-shaped curve.
How do I convert between degrees and radians for tangent?
To convert degrees to radians, multiply by π/180. To convert radians to degrees, multiply by 180/π. For example, 60° = 60 × π/180 = π/3 radians, and π/4 radians = (π/4) × (180/π) = 45°. Most scientific calculators have a degree/radian mode toggle. Programming languages like JavaScript, Python, and C++ use radians by default in their trigonometric functions, so always convert before calling Math.tan() or equivalent. A common error is forgetting this conversion, which produces incorrect results.
What is the relationship between tangent and slope?
The tangent of an angle equals the slope of a line at that angle relative to the horizontal. If a line makes an angle θ with the positive x-axis, its slope m = tan(θ). For example, a line at 45° has slope tan(45°) = 1, meaning it rises 1 unit for every 1 unit of horizontal distance. A line at 60° has slope tan(60°) = √3 ≈ 1.732. This relationship is fundamental in calculus, where the derivative of a function at a point equals the tangent of the angle the tangent line makes with the x-axis.
How is tangent used in real-world applications?
Tangent is used extensively in surveying (calculating building heights from ground-level angle measurements), engineering (designing ramps, roads, and roof pitches), navigation (computing bearings and distances), and physics (analyzing projectile motion and force components). In construction, road grades are expressed as tangent values: a 6% grade means the road rises 6 feet per 100 feet horizontal, which is tan(3.43°). Surveyors use tangent to calculate distances they cannot measure directly by measuring angles to known reference points. GPS systems use tangent relationships for coordinate transformations.