From 937a291485c3a3126caaa5164b54653bc3a5bef0 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 27 May 2024 13:52:52 +0200 Subject: [PATCH] atan2 function in parser --- util.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util.cpp b/util.cpp index ca3c0fc7..fea10f9e 100644 --- a/util.cpp +++ b/util.cpp @@ -236,6 +236,13 @@ cld exp_parser::parse(int prio) { force_eat(")"); res = a; } + else if(eat("atan2(")) { + ld y = rparse(0); + force_eat(","); + ld x = rparse(0); + force_eat(")"); + res = atan2(y, x); + } else if(eat("edge(")) { ld a = rparse(0); force_eat(",");