[apps/shared/continuous_function] Simplify templatedApproximateAtParameter

This commit is contained in:
Ruben Dashyan
2019-09-18 11:55:57 +02:00
committed by Léa Saviot
parent 5750d00574
commit 34aa27ea08

View File

@@ -283,11 +283,11 @@ Coordinate2D<T> ContinuousFunction::templatedApproximateAtParameter(T t, Poincar
char unknown[bufferSize];
Poincare::SerializationHelper::CodePoint(unknown, bufferSize, UCodePointUnknownX);
PlotType type = plotType();
if (type == PlotType::Cartesian || type == PlotType::Polar) {
return Coordinate2D<T>(t, PoincareHelpers::ApproximateWithValueForSymbol(expressionReduced(context), unknown, t, context));
}
assert(type == PlotType::Parametric);
Expression e = expressionReduced(context);
if (type != PlotType::Parametric) {
assert(type == PlotType::Cartesian || type == PlotType::Polar);
return Coordinate2D<T>(t, PoincareHelpers::ApproximateWithValueForSymbol(e, unknown, t, context));
}
assert(e.type() == ExpressionNode::Type::Matrix);
assert(static_cast<Poincare::Matrix&>(e).numberOfRows() == 2);
assert(static_cast<Poincare::Matrix&>(e).numberOfColumns() == 1);