mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 15:50:49 +01:00
[poincare] SquareRoot: use realPart and imaginaryPart to compute the
complexArgument
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user