跳到主要内容

COS

返回角度的余弦值。

语法

expression.COS(arg1);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | ApiName | number将返回其余弦值的弧度角。

返回值

number

示例

计算电子表格中角度的余弦值。

// What is the cosine of a given angle in a spreadsheet?

// Find the ratio of a triangle's side using an angle in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.COS(1.5));