Package jscicalc.complex

Examples of jscicalc.complex.Complex


     * Calculate the square root.
     * @return The result of the operation
     */
    public OObject sqrt(){
  if( this instanceof Expression ){
      return new jscicalc.expression.Power( (Expression)this, new Complex( 0.5 ) );
  }
  return new Error( "OObject sqrt( x ) error" );
    }
View Full Code Here


     * @return The result of the operation
     */
    public OObject cuberoot(){
  if( this instanceof Expression ){
      return new jscicalc.expression.Power( (Expression)this,
              new Complex( (double)1 / 3 ) );
  }
  return new Error( "OObject cuberoot( x ) error" );
    }
View Full Code Here

     * Calculate ten to the power of x.
     * @return The result of the operation
     */
    public OObject tenx(){
  if( this instanceof Expression ){
      return new jscicalc.expression.Power( new Complex( 10 ), (Expression)this );
  }
  return new Error( "OObject tenx( x ) error" );
    }
View Full Code Here

     * Constructor. Sets a tooltip and shortcut. Also stores the value of Pi in
     * the container.
     */
    public Pi(){
  d = new Double( Math.PI );
  c = new Complex( StrictMath.PI );
  ftooltip = "<i>&#960;</i>";
  fshortcut = 'p';
    }
View Full Code Here

  synchronized( applet ){
      if( getApplet().getMode() != 0 ){
    getApplet().setMode( 0 );
    getApplet().setShift( false );
      }
      getApplet().setMemory( new Complex() );
      getApplet().setShift( false );
      getApplet().updateDisplay( true, true );
      getApplet().requestFocusInWindow();
  }
    }
View Full Code Here

    ans.setValue( (Complex)o );
    getApplet().insert( ans );
    getApplet().updateDisplay( true, true );
      }
      o = getApplet().getParser().evaluate( getApplet().getAngleType() );
      Complex d = (Complex)o;
      getApplet().setValue( getApplet().statSub( d ) );
      getApplet().updateDisplay( false, true );
      getApplet().setShift( false );
      getApplet().newExpression();
      getApplet().requestFocusInWindow();
View Full Code Here

    getApplet().insert( ans );
    getApplet().updateDisplay( true, true );
      }
      o = getApplet().getParser().evaluate( getApplet().getAngleType() );
      if( o instanceof Complex ){
    Complex d = (Complex)o;
    getApplet().setValue( getApplet().statAdd( d ) );
    getApplet().updateDisplay( false, true );
      }
      getApplet().setShift( false );
      getApplet().newExpression();
View Full Code Here

     * Constructor: initialises the contained value to zero.
     */
    public Container(){
  error = false;
  d = new Double( 0 );
  c = new Complex();
    }
View Full Code Here

    /**
     * Constructor. Sets a tooltip and shortcut.
     */
    public Ans(){
  d = new Double( 0 );
  c = new Complex();
    }
View Full Code Here

     * @param x The value (right of symbol)
     * @return The result of the operation
     */
    public OObject function( OObject x ){
  if( x instanceof Complex ){
      Complex c = (Complex)x;
      if( scale != 1 && StrictMath.abs( c.imaginary() ) > 1e-6 )
    throw new RuntimeException( "Error" );
      if( scale != 1 && StrictMath.abs( c.real() ) > 1 )
    throw new RuntimeException( "Error" );
      return c.acos().scale( iscale );
  } else {
      return x.acos( angleType );
  }
    }
View Full Code Here

TOP

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