Brighton Webs Ltd.
Statistics for Energy and the Environment
Home Index About

Tangent Function

The graph below plots y=tan(x) over the range -PI to +PI:

Graph of tangent function

Spreadsheets

Both MS Excel and Google Docs spreadsheet have a tan function which require the argument to be supplied in radians:

tan(a1)

If the cell a1 contains an angle specified in degrees, the function can be written:

tan(a1*pi()/180)

Programming Languages

Most programming languages with a math library have a tan function which returns the tangent of an argument supplied in radians e.g.

y=tan(x)

If x is a variable containing an angle specified in degrees, the vb.net style code would look something like this:

y=math.tan(x*math.pi/180)

Page updated: 21-May-2009