forked from PauloCarvalhoRJ/gammaray
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripting.cpp
More file actions
33 lines (25 loc) · 788 Bytes
/
scripting.cpp
File metadata and controls
33 lines (25 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "scripting.h"
//#include "exprtk.hpp"
Scripting::Scripting()
{
}
void Scripting::trig_function()
{
/* typedef exprtk::symbol_table<double> symbol_table_t;
typedef exprtk::expression<double> expression_t;
typedef exprtk::parser<double> parser_t;
std::string expression_string = "clamp(-1.0,sin(2 * pi * x) + cos(x / 2 * pi),+1.0)";
double x;
symbol_table_t symbol_table;
symbol_table.add_variable("x",x);
symbol_table.add_constants();
expression_t expression;
expression.register_symbol_table(symbol_table);
parser_t parser;
parser.compile(expression_string,expression);
for (x = double(-5); x <= double(+5); x += double(0.1))
{
double y = expression.value();
printf("%19.15f\t%19.15f\n",x,y);
}*/
}