[poincare] SquareRoot: use realPart and imaginaryPart to compute the

complexArgument
This commit is contained in:
Émilie Feral
2018-12-06 17:20:01 +01:00
committed by Léa Saviot
parent 68367343ed
commit f8251a74bc
2 changed files with 3 additions and 3 deletions

View File

@@ -25,7 +25,7 @@ public:
Expression realPart(Context & context, Preferences::AngleUnit angleUnit) const override { return complexPart(context, angleUnit, true); }
Expression imaginaryPart(Context & context, Preferences::AngleUnit angleUnit) const override { return complexPart(context, angleUnit, false); }
Expression complexNorm(Context & context, Preferences::AngleUnit angleUnit) const override;
Expression complexArgument(Context & context, Preferences::AngleUnit angleUnit) const override;
//Expression complexArgument(Context & context, Preferences::AngleUnit angleUnit) const override;
private:
// Complex
Expression complexPart(Context & context, Preferences::AngleUnit angleUnit, bool isReal) const;

View File

@@ -27,14 +27,14 @@ Expression SquareRootNode::complexNorm(Context & context, Preferences::AngleUnit
return SquareRoot::Builder(r).shallowReduce(context, angleUnit, ReductionTarget::BottomUpComputation);
}
Expression SquareRootNode::complexArgument(Context & context, Preferences::AngleUnit angleUnit) const {
/*Expression SquareRootNode::complexArgument(Context & context, Preferences::AngleUnit angleUnit) const {
Expression th = childAtIndex(0)->complexArgument(context, angleUnit);
if (th.isUninitialized()) {
return Expression();
}
// TH = th/2
return Division(th, Rational(2)).shallowReduce(context, angleUnit, ReductionTarget::BottomUpComputation);
}
}*/
Expression SquareRootNode::complexPart(Context & context, Preferences::AngleUnit angleUnit, bool real) const {
// real: (1/2)*sqrt(2*(sqrt(x^2+y^2)+x))