Package ptolemy.math

Examples of ptolemy.math.Complex

@author Edward A. Lee, Jeff Tsay, Steve Neuendorffer, Adam Cataldo @version $Id: Complex.java,v 1.91 2007/12/06 21:57:08 cxh Exp $ @since Ptolemy II 0.2 @Pt.ProposedRating Yellow (eal) @Pt.AcceptedRating Red (cxh)

     *  the type of the argument is an ComplexToken.
     *  @param rightArgument The token to subtract from this token.
     *  @return A new ComplexToken containing the result.
     */
    protected ScalarToken _subtract(ScalarToken rightArgument) {
        Complex result = _value.subtract(((ComplexToken) rightArgument)
                .complexValue());
        return new ComplexToken(result);
    }
View Full Code Here


     *
     *  @exception IllegalActionException If there is no director.
     */
    public void fire() throws IllegalActionException {
        super.fire();
        Complex inputValue = ((ComplexToken) (input.get(0))).complexValue();

        double magnitudeValue = Math.sqrt((inputValue.real * inputValue.real)
                + (inputValue.imag * inputValue.imag));

        double angleValue = Math.atan2(inputValue.imag, inputValue.real);
View Full Code Here

     *
     *  @exception IllegalActionException If there is no director.
     */
    public void fire() throws IllegalActionException {
        super.fire();
        Complex complexNumber = ((ComplexToken) (input.get(0))).complexValue();

        x.send(0, new DoubleToken(complexNumber.real));
        y.send(0, new DoubleToken(complexNumber.imag));
    }
View Full Code Here

     */
    public void fire() throws IllegalActionException {
        super.fire();
        double xValue = ((DoubleToken) x.get(0)).doubleValue();
        double yValue = ((DoubleToken) y.get(0)).doubleValue();
        ComplexToken token = new ComplexToken(new Complex(xValue, yValue));
        output.send(0, token);
    }
View Full Code Here

     *  of the Complex is the value of this token, the imaginary part
     *  is set to 0.
     @return A Complex
     */
    public Complex complexValue() {
        return new Complex(_value, 0.0);
    }
View Full Code Here

TOP

Related Classes of ptolemy.math.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.