.Tan()

Published Apr 18, 2023
Contribute to Docs

In C#, the Math.Tan() method returns the tangent of a given angle.

Syntax

Math.Tan(angle);

The Math.Tan() method takes only one parameter, angle, an angle in radians of type double. The method returns the tangent of the angle as a double value or NaN (not a number) if the value of angle equals:

  • NaN
  • NegativeInfinity
  • PositiveInfinity

Codebyte Example

The following example is runnable and returns the tangent of the angle given in degrees:

us
Visit us
code
Hide code
Code
Output
Hide output
Hide output
Loading...

All contributors

Looking to contribute?

Learn C# on Codecademy