mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 22:30:30 +01:00
[apps] Move sumBetweenBounds from Shared::Function to Shared::SumGraphController
This commit is contained in:
committed by
Léa Saviot
parent
1d0668a84c
commit
43d72e082f
@@ -1,5 +1,6 @@
|
||||
#include "integral_graph_controller.h"
|
||||
#include "../../shared/text_field_delegate.h"
|
||||
#include <poincare/integral.h>
|
||||
#include <poincare/layout_helper.h>
|
||||
#include "../app.h"
|
||||
|
||||
@@ -46,4 +47,11 @@ Layout IntegralGraphController::createFunctionLayout(ExpiringPointer<Shared::Fun
|
||||
return LayoutHelper::String(buffer, strlen(buffer), KDFont::SmallFont);
|
||||
}
|
||||
|
||||
Poincare::Expression IntegralGraphController::sumBetweenBounds(Shared::ExpiringPointer<Shared::Function> function, double start, double end, Poincare::Context * context) const {
|
||||
return Poincare::Integral::Builder(function->expressionReduced(context).clone(), Poincare::Symbol::Builder(UCodePointUnknownX), Poincare::Float<double>::Builder(start), Poincare::Float<double>::Builder(end)); // Integral takes ownership of args
|
||||
/* TODO: when we approximate integral, we might want to simplify the integral
|
||||
* here. However, we might want to do it once for all x (to avoid lagging in
|
||||
* the derivative table. */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user