mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 16:20:49 +01:00
[apps/graph/function] Add a method to evaluate the function
Change-Id: I54516369bbbde8d65d98ad41d6e94cd3780e6162
This commit is contained in:
@@ -58,3 +58,10 @@ bool Graph::Function::isActive() {
|
||||
void Graph::Function::setActive(bool active) {
|
||||
m_active = active;
|
||||
}
|
||||
|
||||
float Graph::Function::evaluateAtAbscissa(float x) {
|
||||
Context plotContext;
|
||||
Float xExp = Float(x);
|
||||
plotContext.setExpressionForSymbolName(&xExp, "x");
|
||||
return m_expression->approximate(plotContext);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user