Cosine Calculator — cos(x) in Degrees or Radians
cos(x)
--
Angle in Degrees
--
Angle in Radians
--
How the Cosine Function Works
The cosine function is a fundamental trigonometric function that returns the ratio of the adjacent side to the hypotenuse in a right triangle. Given an angle theta in a right triangle, cos(theta) = adjacent / hypotenuse. According to Wolfram MathWorld, cosine is one of the six standard trigonometric functions and is defined for all real numbers, producing output values between -1 and 1 inclusive. The cosine function has a period of 360 degrees (2pi radians), meaning it repeats its values every full rotation. Unlike sine, cosine is an even function -- cos(-x) = cos(x) for all angles x -- which means its graph is symmetric about the y-axis.
On the unit circle (a circle with radius 1 centered at the origin), the cosine of an angle equals the x-coordinate of the point where the terminal side of the angle intersects the circle. This geometric definition extends cosine beyond the 0-90 degree range of right triangles to all angles, including negative angles and angles greater than 360 degrees. The cosine function is essential across mathematics, physics, engineering, signal processing, and computer graphics, appearing in the dot product, Fourier transforms, rotation matrices, and wave equations. Our sine calculator covers the complementary trigonometric function.
The Cosine Formula and How It Is Calculated
In a right triangle with angle theta:
cos(theta) = Adjacent Side / Hypotenuse
The variables are:
- theta -- The angle being evaluated, measured in degrees or radians
- Adjacent side -- The side of the right triangle that forms the angle theta (not the hypotenuse)
- Hypotenuse -- The longest side, opposite the right angle
To convert between degrees and radians: radians = degrees x pi / 180. For example, 60 degrees = 60 x pi/180 = pi/3 radians.
Worked example: Find cos(60 degrees). In a 30-60-90 triangle with hypotenuse = 2, the side adjacent to the 60-degree angle has length 1. Therefore cos(60) = 1/2 = 0.5. In radians, cos(pi/3) = 0.5. You can verify this with the calculator above.
Key Terms You Should Know
- Radian -- A unit of angle measurement where one full rotation equals 2pi (approximately 6.2832) radians. One radian equals approximately 57.296 degrees. Radians are the default unit in most mathematical formulas and programming languages.
- Unit Circle -- A circle of radius 1 centered at the origin. For any angle theta, the point on the unit circle has coordinates (cos(theta), sin(theta)). This provides a geometric definition of cosine for all angles.
- Even Function -- A function where f(-x) = f(x) for all x. Cosine is even, meaning cos(-30) = cos(30). Graphically, the cosine curve is symmetric about the y-axis.
- Period -- The interval after which a function repeats. The cosine function has a period of 360 degrees (2pi radians), so cos(x) = cos(x + 360) for any angle x.
- Amplitude -- The maximum displacement of a wave from its center. The standard cosine function has an amplitude of 1, oscillating between -1 and +1.
- Pythagorean Identity -- The fundamental relationship sin^2(x) + cos^2(x) = 1, which holds for all angles. This allows you to find cosine from sine (or vice versa) when the quadrant is known.
Exact Cosine Values for Common Angles
The following table lists exact cosine values for standard angles used in mathematics, physics, and engineering. These values are derived from the properties of special right triangles (30-60-90 and 45-45-90) and the unit circle.
| Degrees | Radians | Exact Value | Decimal | Quadrant |
|---|---|---|---|---|
| 0 | 0 | 1 | 1.000000 | I (positive x-axis) |
| 30 | pi/6 | sqrt(3)/2 | 0.866025 | I |
| 45 | pi/4 | sqrt(2)/2 | 0.707107 | I |
| 60 | pi/3 | 1/2 | 0.500000 | I |
| 90 | pi/2 | 0 | 0.000000 | Boundary (I/II) |
| 120 | 2pi/3 | -1/2 | -0.500000 | II |
| 135 | 3pi/4 | -sqrt(2)/2 | -0.707107 | II |
| 150 | 5pi/6 | -sqrt(3)/2 | -0.866025 | II |
| 180 | pi | -1 | -1.000000 | Boundary (II/III) |
| 270 | 3pi/2 | 0 | 0.000000 | Boundary (III/IV) |
| 360 | 2pi | 1 | 1.000000 | Full rotation |
Practical Examples
Example 1: Finding a Side Length in a Right Triangle. A ladder leans against a wall at a 70-degree angle from the ground. The ladder is 20 feet long (the hypotenuse). How far is the base of the ladder from the wall? Distance = hypotenuse x cos(70) = 20 x 0.3420 = 6.84 feet from the wall.
Example 2: Using the Law of Cosines. A triangle has sides a = 8 cm, b = 6 cm, and the included angle C = 45 degrees. Find side c. Using c^2 = a^2 + b^2 - 2ab x cos(C) = 64 + 36 - 2(8)(6) x cos(45) = 100 - 96 x 0.7071 = 100 - 67.88 = 32.12. Therefore c = sqrt(32.12) = 5.67 cm. Our law of cosines calculator automates this calculation for any triangle.
Example 3: Dot Product in Physics. Two force vectors have magnitudes 10 N and 15 N with an angle of 60 degrees between them. The dot product (scalar product) is F1 x F2 x cos(theta) = 10 x 15 x cos(60) = 150 x 0.5 = 75 N. This scalar value is used in calculating work done by a force (W = F x d x cos(theta)) and in determining whether vectors point in similar or opposite directions.
Tips and Common Uses of Cosine
- Use the Pythagorean identity to find cosine from sine. If you know sin(x), then cos(x) = sqrt(1 - sin^2(x)). Be mindful of the sign: cosine is positive in quadrants I and IV, negative in quadrants II and III.
- Remember the cofunction relationship. cos(x) = sin(90 - x) in degrees, or cos(x) = sin(pi/2 - x) in radians. This converts any cosine problem into a sine problem and vice versa.
- Use cosine for horizontal components. In physics, the horizontal component of a vector at angle theta is magnitude x cos(theta). Use the tangent calculator when you need the ratio of vertical to horizontal components directly.
- Check your calculator mode. The most common trigonometry error is computing cosine in the wrong angular mode. cos(90 degrees) = 0, but cos(90 radians) = -0.4481. Always verify whether your tool expects degrees or radians.
- Cosine rule for non-right triangles. The law of cosines (c^2 = a^2 + b^2 - 2ab cos(C)) generalizes the Pythagorean theorem and works for any triangle, not just right triangles.
- Inverse cosine (arccos) for finding angles. If you know the cosine value and need the angle, use arccos. For example, arccos(0.5) = 60 degrees. Our inverse trig calculator handles these computations.
Important Cosine Identities
Trigonometric identities involving cosine are essential tools in algebra, calculus, and applied mathematics. The most important ones include:
- Pythagorean identity: sin^2(x) + cos^2(x) = 1
- Double angle: cos(2x) = cos^2(x) - sin^2(x) = 2cos^2(x) - 1 = 1 - 2sin^2(x)
- Sum formula: cos(A + B) = cos(A)cos(B) - sin(A)sin(B)
- Difference formula: cos(A - B) = cos(A)cos(B) + sin(A)sin(B)
- Half angle: cos(x/2) = sqrt((1 + cos(x))/2)
- Product-to-sum: cos(A)cos(B) = (1/2)[cos(A-B) + cos(A+B)]
These identities are extensively used in simplifying expressions, solving equations, and computing integrals in calculus. The sum and difference formulas, for example, are the mathematical foundation behind Fourier analysis, which decomposes complex signals into sums of sine and cosine waves.
Frequently Asked Questions
What is cos(0) and why does it equal 1?
cos(0) = 1 because at 0 degrees, the adjacent side of a right triangle is identical to the hypotenuse, making their ratio exactly 1. On the unit circle, 0 degrees corresponds to the point (1, 0), where the x-coordinate (cosine) is 1. This is the maximum value the cosine function ever reaches, since the ratio of a side to the hypotenuse can never exceed 1.
How are sine and cosine related to each other?
Cosine is the cofunction of sine, meaning cos(x) = sin(90 - x) for any angle x in degrees. The Pythagorean identity states sin^2(x) + cos^2(x) = 1 for all angles, allowing you to calculate one from the other. Graphically, the cosine wave is identical to the sine wave shifted 90 degrees to the left. Both functions have the same amplitude (1), period (360 degrees), and range ([-1, 1]). Use our sine calculator to compare values.
When is the cosine function negative?
Cosine is negative for angles between 90 and 270 degrees, which corresponds to the second and third quadrants of the coordinate plane. On the unit circle, this is the left half where the x-coordinate is negative. Common negative values include cos(120) = -0.5, cos(135) = -sqrt(2)/2 (approximately -0.707), cos(150) = -sqrt(3)/2 (approximately -0.866), and cos(180) = -1, which is the minimum value cosine ever reaches.
What is the law of cosines and when do you use it?
The law of cosines states that c^2 = a^2 + b^2 - 2ab cos(C), where a, b, c are sides of any triangle and C is the angle opposite side c. Use it to find unknown sides when you know two sides and the included angle (SAS case), or to find unknown angles when you know all three sides (SSS case). It generalizes the Pythagorean theorem, which is its special case when C = 90 degrees and the -2ab cos(90) term equals zero. Our law of cosines calculator solves these problems automatically.
How do you convert between degrees and radians for cosine calculations?
To convert degrees to radians, multiply the degree value by pi/180. To convert radians to degrees, multiply by 180/pi. For example, 60 degrees = 60 x (pi/180) = pi/3 radians (approximately 1.0472). Most programming languages (JavaScript, Python, C) and scientific computing tools use radians as the default unit for trigonometric functions, so degree-to-radian conversion is essential when working with measured angles.
What are the exact cosine values for common angles?
The exact cosine values for the most commonly used angles are: cos(0) = 1, cos(30) = sqrt(3)/2 (approximately 0.866), cos(45) = sqrt(2)/2 (approximately 0.707), cos(60) = 1/2 = 0.5, cos(90) = 0, cos(120) = -1/2, cos(150) = -sqrt(3)/2, cos(180) = -1, cos(270) = 0, and cos(360) = 1. These values come from the 30-60-90 and 45-45-90 special right triangles and the unit circle.