Skip to main content

IMCOS

Returns the cosine of a complex number.

Syntax

expression.IMCOS(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberA complex number expressed in the <em>x + yi</em> or <em>x + yj</em> form.

Returns

number

Example

This example shows how to return the cosine of a complex number.

// How to get the cosine.

// Use a function to get the cosine of a complex number.

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.IMCOS("-2+2.5i"));