From a2124faebc3dc2cabb06fc12417596f382df5c29 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 14 Feb 2023 14:51:57 +0100 Subject: [PATCH] cos, sin, tan --- src/cat.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cat.ts b/src/cat.ts index 46b91b0..c30edd3 100644 --- a/src/cat.ts +++ b/src/cat.ts @@ -242,6 +242,10 @@ export const Primitives: Environment = { '%'(a, b) { return [(a as number) % (b as number)]; }, 'neg'(v) { return [-(v as number)]; }, + 'cos'(n) { return [Math.cos(n as number)]; }, + 'sin'(n) { return [Math.sin(n as number)]; }, + 'tan'(n) { return [Math.tan(n as number)]; }, + 'to'() { const n_or_ns = this.nextToken('to', (v: any): v is (symbol | symbol[]) => typeof v === 'symbol' || (Array.isArray(v) && v.every(w => typeof w === 'symbol')));