f7
f7 is a spreadsheet formula execution library
git clone https://git.vogt.world/f7.git
Log | Files | README.md | LICENSE.md
← All files
name: src/main/js/formulas/math/ACOT.ts
-rw-r--r--
716
 1import { SheetColumnRowKey } from "../../models/common/SheetColumnRowKey";
 2import { Complex } from "../../models/common/Types";
 3import { Converters } from "../../utils/Converters";
 4import { AbstractFormula } from "../AbstractFormula";
 5import { FormulaName } from "../FormulaName";
 6
 7export class ACOT extends AbstractFormula {
 8  static SELF: ACOT = new ACOT();
 9  NAME = FormulaName.ACOT;
10
11  internal(origin: SheetColumnRowKey, ...values: Array<Complex>) {
12    AbstractFormula.checkLength(values.length, 1, this.NAME);
13    const divisor = Converters.toNumber(this.collateralLookup(origin, Converters.first(values[0])));
14    if (divisor === 0) {
15      return 1.570796327;
16    }
17    return Math.atan(1 / divisor);
18  }
19}