mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[apps/calculation] WIP: display the complex graph when clicking on the
burger menu
This commit is contained in:
@@ -213,17 +213,21 @@ Calculation::EqualSign Calculation::exactAndApproximateDisplayedOutputsAreEqual(
|
||||
}
|
||||
}
|
||||
|
||||
Calculation::AdditionalOutput Calculation::additionalOuput(Context * context) {
|
||||
Calculation::AdditionalOutput Calculation::additionalOuput(Context * context, std::complex<float> * c) {
|
||||
ExpressionNode::Type type = exactOutput().type();
|
||||
if (type == ExpressionNode::Type::Rational) {
|
||||
return AdditionalOutput::BaseRepresentation;
|
||||
}
|
||||
Preferences * preferences = Preferences::sharedPreferences();
|
||||
Evaluation<float> e = approximateOutput(context).approximateToEvaluation<float>(context, preferences->complexFormat(), preferences->angleUnit());
|
||||
Evaluation<float> e = approximateOutput(context).approximateToEvaluation<float>(context, Preferences::ComplexFormat::Cartesian, preferences->angleUnit());
|
||||
if (e.type() == EvaluationNode<float>::Type::MatrixComplex) {
|
||||
return AdditionalOutput::None;
|
||||
}
|
||||
Complex<float> ec = static_cast<Complex<float> &>(e);
|
||||
if (c) {
|
||||
c->real(ec.real());
|
||||
c->imag(ec.imag());
|
||||
}
|
||||
// return AdditionalOutput::Matrix
|
||||
if ((type == ExpressionNode::Type::Cosine || type == ExpressionNode::Type::Sine) && ec.imag() == 0.0f) {
|
||||
return AdditionalOutput::TrigonometryCircle;
|
||||
|
||||
Reference in New Issue
Block a user