public Complex(double m, double a, bool w)//Constructive method for modulus argument. { argument = MAL.Round(a, InstantiationDecimals); modulus = MAL.Round(m, InstantiationDecimals); real = MAL.Round((m * MAL.Cos(a)), InstantiationDecimals); imaginary = MAL.Round((m * MAL.Sin(a)), InstantiationDecimals); }
public Complex(double r, double i) { real = MAL.Round(r, InstantiationDecimals); imaginary = MAL.Round(i, InstantiationDecimals); modulus = MAL.Round(getModulus(), InstantiationDecimals); argument = MAL.Round(getArgument(), InstantiationDecimals); }
public string outputRealImaginary() { string realImag; if (imaginary < 0) { realImag = Convert.ToString(MAL.Round(real, OutputDecimals)) + Convert.ToString(MAL.Round(imaginary, OutputDecimals)) + "i"; } else { realImag = Convert.ToString(MAL.Round(real, OutputDecimals)) + " + " + Convert.ToString(MAL.Round(imaginary, OutputDecimals)) + "i"; } return(realImag); }
public string outputModulusArgument() { string modulusArgument = Convert.ToString(MAL.Round(modulus, OutputDecimals)) + "(cos" + Convert.ToString(MAL.Round(argument, OutputDecimals)) + " + isin" + Convert.ToString(MAL.Round(argument, OutputDecimals)) + ")"; return(modulusArgument); }