Skip to main content

TAN

Returns the tangent of an angle.

Syntax

expression.TAN(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe angle in radians for which the tangent will be returned. If the argument is in degrees, multiply it by <em>PI()/180</em>.

Returns

number

Example

This example shows how to return the tangent of an angle.

// How to return a tangent of an angle.

// Use a function to calculate angle's tangent.

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.TAN(0.5));