Class CartesianToPolar

    • Field Detail

      • x

        public TypedIOPort x
        The x coordinate of the input pair, which has type DoubleToken.
      • y

        public TypedIOPort y
        The y coordinate of the input pair, which has type DoubleToken.
      • magnitude

        public TypedIOPort magnitude
        The magnitude component of the output pair, which has type DoubleToken.
      • angle

        public TypedIOPort angle
        The angle component of the output pair, which has type DoubleToken.
    • Method Detail

      • fire

        public void fire()
                  throws IllegalActionException
        Consume one double token from each of the two input ports (x and y), and output one new double token on each of the two output ports (magnitude and angle). The output is a polar form representation of the Cartesian pair given at the inputs. The angle is in radians.
        Specified by:
        fire in interface Executable
        Overrides:
        fire in class AtomicActor<TypedIOPort>
        Throws:
        IllegalActionException - If there is no director.