Skip to main content

SEC

Returns the secant of an angle.

Syntax

expression.SEC(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe angle in radians for which the secant will be returned.

Returns

number

Example

Return the secant of an angle in a spreadsheet.

// Get the secant value of an angle using the SEC function.

// Apply the function to calculate and display the result in a cell.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.SEC(0.785398));