Hello.

Le jeu. 12 déc. 2019 à 10:04, Alex Herbert <alex.d.herb...@gmail.com> a écrit :
>
> There is a factory constructor:
>
> Complex.ofReal(double)
>
> For completeness I think we should add:
>
> Complex.ofImaginary(double)

I wonder whether we should remove "ofReal".
It's a shortcut that does not save a lot of typing, IMHO not worth adding
to the API.

>
> We also have negate() as a helper. I think the following are also useful:
>
> Complex multiplyI()
> Complex multiplyNegativeI()

Applicability (and name) is not straightforward, other than where it is
used internally.  I'd keep those "private".

For the API, perhaps a more general
---CUT---
public Complex multiplyImaginary(double im) {
    return ofCartesian(-im * imaginary, im * real);
}
---CUT---
?

Gilles

> These two operations appear a lot in the formulas for the trigonomic 
> functions.
>
> They essentially just swap the real and imaginary parts and update the sign 
> appropriately.
>
> Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to