[apps/graph] Use CartesianFunction::nextIntersectionFrom in

PreimageGraphController to compute the preimage
This commit is contained in:
Émilie Feral
2019-09-09 11:09:29 +02:00
parent 37fd6f4d76
commit 111a789f51
4 changed files with 7 additions and 11 deletions

View File

@@ -47,7 +47,7 @@ Poincare::Coordinate2D<double> IntersectionGraphController::computeNewPointOfInt
Ion::Storage::Record record = functionStore()->activeRecordAtIndex(i);
if (record != m_record) {
CartesianFunction f = *(functionStore()->modelForRecord(record));
Poincare::Coordinate2D<double> intersection = functionStore()->modelForRecord(m_record)->nextIntersectionFrom(start, step, max, context, &f);
Poincare::Coordinate2D<double> intersection = functionStore()->modelForRecord(m_record)->nextIntersectionFrom(start, step, max, context, f.expressionReduced(context), f.tMin(), f.tMax());
if ((std::isnan(result.x1()) || std::fabs(intersection.x1()-start) < std::fabs(result.x1()-start)) && !std::isnan(intersection.x1())) {
m_intersectedRecord = record;
result = (std::isnan(result.x1()) || std::fabs(intersection.x1()-start) < std::fabs(result.x1()-start)) ? intersection : result;