mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 01:08:15 +01:00
[apps/graph] DefDomain depends on angleUnit
When automatically setting the definition domain of a non-cartesian curve, take into account the angle unit: 0..360 for Degrees, 0..400 for gradians...
This commit is contained in:
committed by
EmilieNumworks
parent
aa0f388e0a
commit
22c7fb440e
@@ -8,6 +8,7 @@
|
||||
#include <poincare/multiplication.h>
|
||||
#include <poincare/rational.h>
|
||||
#include <poincare/serialization_helper.h>
|
||||
#include <poincare/trigonometry.h>
|
||||
#include <escher/palette.h>
|
||||
#include <ion/unicode/utf8_decoder.h>
|
||||
#include <apps/i18n.h>
|
||||
@@ -119,7 +120,7 @@ CartesianFunction::PlotType CartesianFunction::plotType() const {
|
||||
return recordData()->plotType();
|
||||
}
|
||||
|
||||
void CartesianFunction::setPlotType(PlotType newPlotType) {
|
||||
void CartesianFunction::setPlotType(PlotType newPlotType, Poincare::Preferences::AngleUnit angleUnit) {
|
||||
PlotType currentPlotType = plotType();
|
||||
if (newPlotType == currentPlotType) {
|
||||
return;
|
||||
@@ -132,7 +133,7 @@ void CartesianFunction::setPlotType(PlotType newPlotType) {
|
||||
|
||||
// Recompute the definition domain
|
||||
double tMin = newPlotType == PlotType::Cartesian ? -INFINITY : 0.0;
|
||||
double tMax = newPlotType == PlotType::Cartesian ? INFINITY : 2.0*M_PI;
|
||||
double tMax = newPlotType == PlotType::Cartesian ? INFINITY : 2.0*Trigonometry::PiInAngleUnit(angleUnit);
|
||||
setTMin(tMin);
|
||||
setTMax(tMax);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user