Package flanagan.complex

Examples of flanagan.complex.Complex


        // Reads a Complex from the dialog box
        // No prompt message, No default option
        public static final synchronized Complex readComplex(){
                String line="";
                String mess="Input type: Complex (x + jy)";
                Complex c = new Complex();
                boolean finish = false;
                System.out.flush();

                while(!finish){
                        line = JOptionPane.showInputDialog(mess);
View Full Code Here


                return ph;
        }

        // converts the Phasor to a rectangular complex variable
        public Complex toRectangular(){
                Complex cc = new Complex();
                cc.polar(this.magnitude, this.phaseInRad);
                return cc;
        }
View Full Code Here

                return cc;
        }

        // converts the Phasor to a rectangular complex variable - static method
        public static Complex toRectangular(Phasor ph){
                Complex cc = new Complex();
                cc.polar(ph.magnitude, ph.phaseInRad);
                return cc;
        }
View Full Code Here

                return cc;
        }

        // converts the Phasor to a rectangular complex variable
        public Complex toComplex(){
                Complex cc = new Complex();
                cc.polar(this.magnitude, this.phaseInRad);
                return cc;
        }
View Full Code Here

                return cc;
        }

        // converts the Phasor to a rectangular complex variable - static method
        public static Complex toComplex(Phasor ph){
                Complex cc = new Complex();
                cc.polar(ph.magnitude, ph.phaseInRad);
                return cc;
        }
View Full Code Here

                if(prec<0)return this;

                double xMa = this.magnitude;
                double xPd = this.phaseInDeg;
                double xPr = this.phaseInRad;
                Complex xRect = this.rectangular;

                Phasor y = new Phasor();

                y.magnitude = Fmath.truncate(xMa, prec);
                y.phaseInDeg = Fmath.truncate(xPd, prec);
View Full Code Here

                if(prec<0)return ph;

                double xMa = ph.magnitude;
                double xPd = ph.phaseInDeg;
                double xPr = ph.phaseInRad;
                Complex xRect = ph.rectangular;

                Phasor y = new Phasor();

                y.magnitude = Fmath.truncate(xMa, prec);
                y.phaseInDeg = Fmath.truncate(xPd, prec);
View Full Code Here

        // ADDITION

        // Add a Phasor to this Phasor
        // this Phasor remains unaltered
        public Phasor plus(Phasor ph){
                Complex com1 = this.toRectangular();
                Complex com2 = ph.toRectangular();
                Complex com3 = com1.plus(com2);
                return Phasor.toPhasor(com3);
        }
View Full Code Here

        // Add a complex number to this Phasor
        // this Phasor remains unaltered
        public Phasor plus(Complex com1){
                Phasor ph = new Phasor();
                Complex com2 = this.toRectangular();
                Complex com3 = com1.plus(com2);
                return Phasor.toPhasor(com3);
        }
View Full Code Here

                return Phasor.toPhasor(com3);
        }

        // Add a Phasor to this Phasor and replace this with the sum
        public void plusEquals(Phasor ph1 ){
                Complex com1 = this.toRectangular();
                Complex com2 = ph1.toRectangular();
                Complex com3 = com1.plus(com2);
                Phasor ph2 = Phasor.toPhasor(com3);
                this.magnitude = ph2.magnitude;
                this.phaseInDeg = ph2.phaseInDeg;
                this.phaseInRad = ph2.phaseInRad;
        }
View Full Code Here

TOP

Related Classes of flanagan.complex.Complex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.