Repository navigation
Cpx (class)
Cpx is a static subclass of the Complex class. Cpx allows for Complex functions to be implemented external to the Complex class. People familiar with C++ might find the implemented functions functionally similar to friend functions. Cpx stands for "complex". It's intentionally short so that calls to it are quick and take up little screen real estate.
The purpose of this tab is so that, if someone wants to create a math heavy function, they can create a class which extends Cpx and declare the function inside that class. That way, they can just casually say "sin(inp)" or "exp(number)" within that chunk of code. However, if for any reason, the programmer is unable to declare it in such a way (for instance, maybe they have to declare the function within another class which strictly cannot extend Cpx), the short name still gives minimal hassle in implementation.
The basic trig, hyperbolic, and inverse trig functions are implemented exclusively inside the Cpx class. As is the unlimited input add and mul functions, as well as all arithmetic functions whereby all inputs are parameters (that is, no inputs prefix the function). Such functions might prove to be helpful, such as if the programmer wants to subtract a complex from a double or compute the quotient between a double and a complex respectively. The Cpx class also defines a few external constructors, such as Complex (without "new") or iTimes (which allows one to define a new complex number with no real part).