From f55d861f40dd10f0a05b8121886dc1115696bb30 Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Wed, 23 Jul 1997 15:06:43 +0000 Subject: [PATCH] Added aten2 function pre Nick Rees. --- src/libCom/calc/calcPerform.c | 5 +++++ src/libCom/calc/postfix.c | 1 + src/libCom/calc/postfix.h | 1 + src/libCom/calcPerform.c | 5 +++++ src/libCom/postfix.c | 1 + src/libCom/postfix.h | 1 + 6 files changed, 14 insertions(+) diff --git a/src/libCom/calc/calcPerform.c b/src/libCom/calc/calcPerform.c index dd3c78de1..8e7cdfd6e 100644 --- a/src/libCom/calc/calcPerform.c +++ b/src/libCom/calc/calcPerform.c @@ -439,6 +439,11 @@ printf ("*FINISHED*\n"); *pstacktop = atan(*pstacktop); break; + case ATAN2: + --pstacktop; + *pstacktop = atan2(*(pstacktop+1), *pstacktop); + break; + case COS: *pstacktop = cos(*pstacktop); break; diff --git a/src/libCom/calc/postfix.c b/src/libCom/calc/postfix.c index 38b780354..9eb418d26 100644 --- a/src/libCom/calc/postfix.c +++ b/src/libCom/calc/postfix.c @@ -163,6 +163,7 @@ static struct expression_element elements[] = { "LOG", 7, 8, UNARY_OPERATOR, LOG_10, /* log 10 */ "ACOS", 7, 8, UNARY_OPERATOR, ACOS, /* arc cosine */ "ASIN", 7, 8, UNARY_OPERATOR, ASIN, /* arc sine */ +"ATAN2", 7, 8, UNARY_OPERATOR, ATAN2, /* arc tangent */ "ATAN", 7, 8, UNARY_OPERATOR, ATAN, /* arc tangent */ "MAX", 7, 8, UNARY_OPERATOR, MAX, /* maximum of 2 args */ "MIN", 7, 8, UNARY_OPERATOR, MIN, /* minimum of 2 args */ diff --git a/src/libCom/calc/postfix.h b/src/libCom/calc/postfix.h index f2a7d2b72..c933d2b34 100644 --- a/src/libCom/calc/postfix.h +++ b/src/libCom/calc/postfix.h @@ -115,6 +115,7 @@ #define CONST_D2R 74 #define CONST_R2D 75 #define NINT 76 +#define ATAN2 77 #define END_STACK 127 #endif /* INCpostfixh */ diff --git a/src/libCom/calcPerform.c b/src/libCom/calcPerform.c index dd3c78de1..8e7cdfd6e 100644 --- a/src/libCom/calcPerform.c +++ b/src/libCom/calcPerform.c @@ -439,6 +439,11 @@ printf ("*FINISHED*\n"); *pstacktop = atan(*pstacktop); break; + case ATAN2: + --pstacktop; + *pstacktop = atan2(*(pstacktop+1), *pstacktop); + break; + case COS: *pstacktop = cos(*pstacktop); break; diff --git a/src/libCom/postfix.c b/src/libCom/postfix.c index 38b780354..9eb418d26 100644 --- a/src/libCom/postfix.c +++ b/src/libCom/postfix.c @@ -163,6 +163,7 @@ static struct expression_element elements[] = { "LOG", 7, 8, UNARY_OPERATOR, LOG_10, /* log 10 */ "ACOS", 7, 8, UNARY_OPERATOR, ACOS, /* arc cosine */ "ASIN", 7, 8, UNARY_OPERATOR, ASIN, /* arc sine */ +"ATAN2", 7, 8, UNARY_OPERATOR, ATAN2, /* arc tangent */ "ATAN", 7, 8, UNARY_OPERATOR, ATAN, /* arc tangent */ "MAX", 7, 8, UNARY_OPERATOR, MAX, /* maximum of 2 args */ "MIN", 7, 8, UNARY_OPERATOR, MIN, /* minimum of 2 args */ diff --git a/src/libCom/postfix.h b/src/libCom/postfix.h index f2a7d2b72..c933d2b34 100644 --- a/src/libCom/postfix.h +++ b/src/libCom/postfix.h @@ -115,6 +115,7 @@ #define CONST_D2R 74 #define CONST_R2D 75 #define NINT 76 +#define ATAN2 77 #define END_STACK 127 #endif /* INCpostfixh */