//PlaneWaveOutputPanel.java
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.lang.*;  

public class PlaneWaveOutputPanel extends Panel implements ItemListener{
	PlaneWave_State state;
	//private static final Color bgcolor = Color.lightGray;
	private static final Color bgcolor = new Color(236,236,236);
	private static final Font labfont=new Font("SanSerif",Font.PLAIN,11);
	//private static final Font symbolfont=new Font("Symbol",Font.PLAIN,12);
	private static final Font symbolfont=new Font("Serif",Font.PLAIN,11);
	
        private static final Font titlefont=new Font("SanSerif",Font.BOLD,16);
	Label titlelabel;	
	public Choice c1;
	public PlaneWaveOutputCanvasA pwocA; 
	public PlaneWaveOutputCanvasB pwocB; 
        public PlaneWaveOutputCanvasC pwocC; 
	public PlaneWaveOutputPanel(PlaneWave_State state){
	    super();
	    setLayout(null);
            this.state = state;
	    setBackground(bgcolor);
	    titlelabel = new Label("Output Data");
	    //add(titlelabel);
	    //titlelabel.setBounds(5,5,300,40);    
	    titlelabel.setFont(titlefont);
	    
	    c1 = new Choice();
	    c1.addItem("   Impedance Properties   ");
	    c1.addItem("   Wave Properties   ");
            c1.addItem("   Fields   ");
            
	    //add(c1);
	    c1.setBounds(110,5,170,30);
	    
	    pwocA = new PlaneWaveOutputCanvasA(state);
	    add(pwocA);
	    pwocA.setBounds(0,0,280,275);
	    pwocB = new PlaneWaveOutputCanvasB(state);
	    add(pwocB);
	    pwocB.setBounds(0,0,280,275);
            pwocC = new PlaneWaveOutputCanvasC(state);
	    add(pwocC);
	    pwocC.setBounds(0,0,280,275);
	    
	    pwocA.setVisible(false);
	    pwocB.setVisible(false);
            pwocC.setVisible(true);
	    //Listeners
	    c1.addItemListener(this);
	}


public void itemStateChanged(ItemEvent evt){
	ItemSelectable ie = evt.getItemSelectable();
	    if(evt.getSource()==c1){
		if(ie.getSelectedObjects()[0]=="   Wave Properties   "){
		    pwocA.setVisible(true);
		    pwocB.setVisible(false);
                    pwocC.setVisible(false);
		}
		else if(ie.getSelectedObjects()[0]=="   Fields   "){
		    pwocA.setVisible(false);
		    pwocB.setVisible(true);
                    pwocC.setVisible(false);
		}
                else if(ie.getSelectedObjects()[0]=="   Impedance Properties   "){
		    pwocA.setVisible(false);
		    pwocB.setVisible(false);
                    pwocC.setVisible(true);
		}
	    }
    }	
}//PlaneWaveOutputPanel.java
class PlaneWaveOutputCanvasA extends Canvas{
	private static final Font normalfont = new Font("SanSerif",Font.PLAIN,11);
	private static final Font symbolfont = new Font("Serif",Font.PLAIN,13);
	private static final Font subfont    = new Font("SanSerif",Font.PLAIN,10);
	PlaneWave_State state;
	private Image im;
	private Graphics buf;

	public PlaneWaveOutputCanvasA(PlaneWave_State state){
	    super();
	    this.state = state;
	}
	
	public void paint(Graphics g){
	    if(im == null){
		im = createImage(getSize().width,getSize().height);
		buf = im.getGraphics();
		drawGraph(buf);
	    }
	    else{
		drawGraph(buf);
	    }
	    g.drawImage(im,0,0,null);
	}
	
	//Addition to reduce flicker new routine
	public void update(Graphics g){		// added to avoid clearing
	    paint(g);
	}

	
	public void drawGraph(Graphics g){
	    int x, y, dx, dxx, dy, dyy;
	    double v_normalized;
	    FontMetrics fm;
	    double temp, temp2;
	    int fonto = 11;
            int fonto_delta = 12;
	    
            Graphics2D g2d = (Graphics2D)g;
            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
            
            x = 20;
	    y = 50;
	    dx = 90;
	    dxx = 15;
	    
	    
	    g.setFont(normalfont);
	    fm = g.getFontMetrics();
	    dy = fm.getHeight()-1;
	    dyy = dy+3;
	    g.clearRect(0,0,getSize().width,getSize().height);
	    g.setColor(Color.red.darker());
	    g.drawString("WaveLength",x,y);	
	    //y += dy;
	    
            int startx = 12;
            
            g.setColor(Color.gray);
            MaestroG.subscripterBold("Output","","",g,14,startx+1,startx+6);
            g.setColor(Color.red.darker());
            MaestroG.subscripterBold("Output","","",g,14,startx,startx+5);
            
            
            g.setColor(Color.black);
	    //g.drawString("  =  "+MaestroA.rounder(state.wavelength,15)+"   [ m ]",x+dx+10,y);
	    temp2 = state.wavelength;
	    g.setFont(symbolfont);
	    g.drawString("\u03bb",x+dx,y);
	    g.setFont(normalfont);	
	    
	    
		    if(state.frequency == 0.0){
			
			g.drawString("  =        [ m ]",x+dx+10,y);
			g.setFont(symbolfont);
			g.drawString("\u221e",x+dx+fm.stringWidth("  =   "),y);
			g.setFont(normalfont);
		    }
		    else if(temp2 >= 1.0E15 && state.frequency > 0.0){
			temp = temp2;
			MaestroG.superscripter("  =  "+temp+"   [ m ]","","",g,fonto,x+dx+10,y); 
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ Tm ]",x+dx+10,y); 
		    }
		    
		    else if(temp2 < 1.0e15 && temp2 >= 1.0E12){
			temp = temp2/1.0E12;
			MaestroG.superscripter("  =  "+MaestroA.rounder(temp,5)+"   [ 10","9"," km ]",g,fonto,x+dx+10,y); 
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ Tm ]",x+dx+10,y); 
		    }
		    else if(temp2 < 1.0e12 && temp2 >= 1.0e9){
			temp = temp2/1.0E9;
			MaestroG.superscripter("  =  "+MaestroA.rounder(temp,5)+"   [ 10","6"," km ]",g,fonto,x+dx+10,y);   
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ Gm ]",x+dx+10,y); 
		    }
		    else if(temp2 < 1.0e9 && temp2 >= 1.0e6){
			temp = temp2/1.0E6; 
			MaestroG.superscripter("  =  "+MaestroA.rounder(temp,5)+"   [ 10","3"," km ]",g,fonto,x+dx+10,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ Mm ]",x+dx+10,y); 
		    }
		    else if(temp2 < 1.0E6 && temp2 >= 1.0E3){
			temp = temp2/1.0E3;
			g.drawString("  =  "+MaestroA.rounder(temp,5)+"   [ km ]",x+dx+10,y); 
		    }
		    else if(temp2 < 1.0E3 && temp2 >= 1.0){
			g.drawString("  =  "+MaestroA.rounder(temp2,5)+"   [ m ]",x+dx+10,y); 
		    }
		    else if(temp2 <1.0 && temp2 >= 1.0E-2){
			temp = temp2*1.0E2;
			g.drawString("  =  "+MaestroA.rounder(temp,5)+"   [ cm ]",x+dx+10,y); 
		    }
		    else if(temp2 <1.0E-2 && temp2 >= 1.0E-4){
			temp = temp2*1.0E3;
			g.drawString("  =  "+MaestroA.rounder(temp,5)+"   [ mm ]",x+dx+10,y); 
		    }
		    else if(temp2 < 1.0E-4 && temp2 >=1.0E-6 ){
			temp = temp2*1.0E6;
			g.drawString("  =  "+MaestroA.rounder(temp,5)+"   [ \u00b5 m ]",x+dx+10,y); 
		    }
		    else if(temp2 < 1.0E-6 && temp2 >=1.0E-9){
			temp = temp2*1.0E9;
			g.drawString("  =  "+MaestroA.rounder(temp,5)+"   [ nm ]",x+dx+10,y); 
		    }	
		    else if(temp2 < 1.0E-9 && temp2 >=1.0E-12){
			temp = temp2*1.0E12;
			MaestroG.superscripter("  =  "+MaestroA.rounder(temp,5)+"   [ 10","-12","  m ]",g,fonto,x+dx+10,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ pm ]",x+dx+10,y); 
		    }	   
		    else if(temp2 < 1.0E-12 && temp2 >=1.0E-15){
			temp = temp2*1.0E15;
			MaestroG.superscripter("  =  "+MaestroA.rounder(temp,5)+"   [ 10","-15","  m ]",g,fonto,x+dx+10,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ fm ]",x+dx+10,y); 
		    }
		    else if(temp2 < 1.0E-15 && temp2 >=1.0e-18){
			temp = temp2*1.0E18;
			MaestroG.superscripter("  =  "+MaestroA.rounder(temp,5)+"   [ 10","-18","  m ]",g,fonto,x+dx+10,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ am ]",x+dx+10,y); 
		    }
		    else if(temp2 < 1.0E-18 && temp2 >=1.0E-21){
			temp = temp2*1.0E21;
			MaestroG.superscripter("  =  "+MaestroA.rounder(temp,5)+"   [ 10","-21","  m ]",g,fonto,x+dx+10,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ fm ]",x+dx+10,y); 
		    }
		    else if(temp2 < 1.0E-21 && temp2 > 0.0){
			temp = temp2;
			MaestroG.superscripter("  =  "+temp+" [m]","","",g,fonto,x+dx+10,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ fm ]",x+dx+10,y); 
		    }
			       
		    else if(temp2 == 0.0){
			g.drawString("  =  "+MaestroA.rounder(temp2,8)+"   [ m ]",x+dx+10,y); 
		    }   

	    //g.drawLine(5,y,getSize().width-5,y); 
	    y += dyy;
	    g.setColor(Color.red.darker());
	    g.drawString("Phase Velocity",x,y);
	    g.setColor(Color.black);
	    //y+= dy;
	    if(state.phase_velocity >= 1.0e8){
		v_normalized = state.phase_velocity/1.0E8;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","8"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+8  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e7 && state.phase_velocity < 1.0e8){
		v_normalized = state.phase_velocity/1.0E7;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","7"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+7  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e6 && state.phase_velocity < 1.0e7){
		v_normalized = state.phase_velocity/1.0E6;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","6"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+6  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e5 && state.phase_velocity < 1.0e6){
		v_normalized = state.phase_velocity/1.0E5;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","5"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+5  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e4 && state.phase_velocity < 1.0e5){
		v_normalized = state.phase_velocity/1.0E4;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","4"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+4  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e3 && state.phase_velocity < 1.0e4){
		v_normalized = state.phase_velocity/1.0E3;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","3"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+3  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e2 && state.phase_velocity < 1.0e3){
		v_normalized = state.phase_velocity/1.0E2;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","2"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+2  m / s ]",x+dxx,y);
	    }
	    //else if(state.phase_velocity >= 1.0e1 && state.phase_velocity < 1.0e2){
		//v_normalized = state.phase_velocity/10.0;
		//MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10",""," [ m / s ]",g,fonto,x+dx,y);
		////g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+1  m / s ]",x+dxx,y);
	    //}
	    else if(state.phase_velocity >= 1.0 && state.phase_velocity < 1.0e2){
		v_normalized = state.phase_velocity;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+"",""," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e-1 && state.phase_velocity < 1.0){
		v_normalized = state.phase_velocity*10.0;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-1"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+1  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e-2 && state.phase_velocity < 1.0e-1){
		v_normalized = state.phase_velocity*1.0e2;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-2"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+1  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e-3 && state.phase_velocity < 1.0e-2){
		v_normalized = state.phase_velocity*1.0e3;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-3"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+1  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e-4 && state.phase_velocity < 1.0e-3){
		v_normalized = state.phase_velocity*1.0e4;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-4"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+1  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e-5 && state.phase_velocity < 1.0e-4){
		v_normalized = state.phase_velocity*1.0e5;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-5"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+1  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e-6 && state.phase_velocity < 1.0e-5){
		v_normalized = state.phase_velocity*1.0e6;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-6"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+1  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e-7 && state.phase_velocity < 1.0e-6){
		v_normalized = state.phase_velocity*1.0e7;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-7"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+1  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e-8 && state.phase_velocity < 1.0e-7){
		v_normalized = state.phase_velocity*1.0e8;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-8"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+1  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity >= 1.0e-9 && state.phase_velocity < 1.0e-8){
		v_normalized = state.phase_velocity*1.0e9;
		MaestroG.subsupspecial("u","p","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-9"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+1  m / s ]",x+dxx,y);
	    }
	    else if(state.phase_velocity < 1.0e-9){
		v_normalized = state.phase_velocity*1.0e10;
		MaestroG.subsupspecial("u","p","  =  "+v_normalized+" \u00d7 10","-10"," [ m / s ]",g,fonto,x+dx,y);
		//g.drawString("Vp  =  "+MaestroA.rounder(v_normalized,5)+"   [ 1.0 E+1  m / s ]",x+dxx,y);
	    }
	    
	    
            //----------------------------------------- Period
            dx = dx +3;
            y += dyy+2;
	    g.setColor(Color.red.darker());
	    g.drawString("Period",x,y);
	    g.setColor(Color.black);
	    //y+= dy;
	    if(state.period >= 1.0e8){
		v_normalized = state.period/1.0E8;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","8"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e7 && state.period < 1.0e8){
		v_normalized = state.period/1.0E7;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","7"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e6 && state.period < 1.0e7){
		v_normalized = state.period/1.0E6;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","6"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e5 && state.period < 1.0e6){
		v_normalized = state.period/1.0E5;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","5"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e4 && state.period < 1.0e5){
		v_normalized = state.period/1.0E4;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","4"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e3 && state.period < 1.0e4){
		v_normalized = state.period/1.0E3;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","3"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e2 && state.period < 1.0e3){
		v_normalized = state.period/1.0E2;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","2"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    //else if(state.period >= 1.0e1 && state.period < 1.0e2){
		//v_normalized = state.period/10.0;
		//MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10",""," [ s ]",g,fonto,x+dx,y);
		
	    //}
	    else if(state.period >= 1.0 && state.period < 1.0e2){
		v_normalized = state.period;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+"",""," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e-1 && state.period < 1.0){
		v_normalized = state.period*10.0;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-1"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e-2 && state.period < 1.0e-1){
		v_normalized = state.period*1.0e2;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-2"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e-3 && state.period < 1.0e-2){
		v_normalized = state.period*1.0e3;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-3"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e-4 && state.period < 1.0e-3){
		v_normalized = state.period*1.0e4;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-4"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e-5 && state.period < 1.0e-4){
		v_normalized = state.period*1.0e5;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-5"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e-6 && state.period < 1.0e-5){
		v_normalized = state.period*1.0e6;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-6"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e-7 && state.period < 1.0e-6){
		v_normalized = state.period*1.0e7;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-7"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e-8 && state.period < 1.0e-7){
		v_normalized = state.period*1.0e8;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-8"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e-9 && state.period < 1.0e-8){
		v_normalized = state.period*1.0e9;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-9"," [ s ]",g,fonto,x+dx,y);
		
	    }
	    else if(state.period >= 1.0e-10 && state.period < 1.0e-9){
		v_normalized = state.period*1.0e10;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-10"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-11 && state.period < 1.0e-10){
		v_normalized = state.period*1.0e11;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-11"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-12 && state.period < 1.0e-11){
		v_normalized = state.period*1.0e12;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-12"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-13 && state.period < 1.0e-12){
		v_normalized = state.period*1.0e13;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-13"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-14 && state.period < 1.0e-13){
		v_normalized = state.period*1.0e14;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-14"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-15 && state.period < 1.0e-14){
		v_normalized = state.period*1.0e15;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-15"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-16 && state.period < 1.0e-15){
		v_normalized = state.period*1.0e16;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-16"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-17 && state.period < 1.0e-16){
		v_normalized = state.period*1.0e17;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-17"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-18 && state.period < 1.0e-17){
		v_normalized = state.period*1.0e18;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-18"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-19 && state.period < 1.0e-18){
		v_normalized = state.period*1.0e19;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-19"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-20 && state.period < 1.0e-19){
		v_normalized = state.period*1.0e20;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-20"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-21 && state.period < 1.0e-20){
		v_normalized = state.period*1.0e21;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-21"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-22 && state.period < 1.0e-21){
		v_normalized = state.period*1.0e22;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-22"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-23 && state.period < 1.0e-22){
		v_normalized = state.period*1.0e23;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-23"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period >= 1.0e-24 && state.period < 1.0e-23){
		v_normalized = state.period*1.0e24;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-24"," [ s ]",g,fonto,x+dx,y);
		
	    }
            else if(state.period < 1.0e-24){
		v_normalized = state.period*1.0e25;
		MaestroG.subsupspecial2("T","","  =  "+MaestroA.rounder(v_normalized,5)+" \u00d7 10","-25"," [ s ]",g,fonto,x+dx,y);
		
	    }
            //------------------------------------------------
            dx = dx - 3;
	    //g.drawLine(5,y,getSize().width-5,y); 
	    g.setColor(Color.red.darker());
	    y += dyy;
	    g.drawString("Impedance of the Medium  [     ]", x, y);
	    g.setFont(symbolfont);
	    g.drawString("\u03a9",x+fm.stringWidth("Impedance of the Medium  [ "),y);
	    g.setFont(normalfont);	
	    y+= dy;
	    g.setColor(Color.black);
	    
	    g.setFont(symbolfont);
	    g.drawString("\u03b7",x+dxx,y);
	    g.setFont(normalfont);	
	    
	    //g.drawString(" =  "+state.wave_impedance.toString(Complex.CARTESIAN,6),x+dxx+10,y);
	    //y+= dy;
	    //g.drawString(" =  "+state.wave_impedance.toString(Complex.POLAR_RADIAN,6),x+dxx+10,y);
	    //y+= dy;
	    //g.drawString(" =  "+state.wave_impedance.toString(Complex.POLAR_DEGREE,6),x+dxx+10,y);
	    
	    
            //----------------------------------------------------------------------------------
            
            
            //MaestroG.SansNosansSymb2("",""," [ "+Ohm+" ]",g,10,x,y+dy);
                int xinit2, xinit3, stepx;
                double tempR, tempX;
                
                String alpha, Ohm, lambda, infinity, Gamma, plusj, minusj, 
                       sign, plusr, minusr, signr;
		
                plusj =" + j ";
		minusj=" - j ";
                plusr ="";
                minusr =" - ";
            
                xinit2 = x+dxx+10;
                
                    tempR=0.0; tempX=0.0;
                    stepx = 0;
                    
		    if(Complex.Imaginary(state.wave_impedance) >= 0.0){sign = plusj;}
		    else{sign = minusj;}
		    
                    tempR = state.wave_impedance.Real();
		    
		    if(tempR < 1.0E3 && tempR >= 1.0E-3){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR,6),"","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR,6));
		    }
		    else if(tempR == 0.0){
			MaestroG.superscripter("  = 0.0","","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = 0.0 ");
		    }
		    else if(tempR < 1.0E6 && tempR >= 1.0E3){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E-3,2)+" \u00d7 10","3","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E-3,2)+"x 10 3");
		    }
		    else if(tempR < 1.0E9 && tempR >= 1.0E6){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E-6,2)+" \u00d7 10","6","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E-6,2)+"x 10 6");
		    }
		    else if(tempR < 1.0E12 && tempR >= 1.0E9){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E-9,2)+" \u00d7 10","9","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E-9,2)+"x 10 9");
		    }
		    else if(tempR < 1.0E15 && tempR >= 1.0E12){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E-12,2)+" \u00d7 10","12","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E-12,2)+"x 10 12");
		    }
		    else if(tempR < 1.0E18 && tempR >= 1.0E15){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E-15,2)+" \u00d7 10","15","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E-15,2)+"x 10 15");
		    }
		    else if(tempR < 1.0E21 && tempR >= 1.0E18){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E-18,2)+" \u00d7 10","18","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E-18,2)+"x 10 18");
		    }
		    else if(tempR < 1.0E24 && tempR >= 1.0E21){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E-21,2)+" \u00d7 10","21","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E-21,2)+"x 10 21");
		    }
		    else if(tempR < 1.0E27 && tempR >= 1.0E24){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E-24,2)+" \u00d7 10","24","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E-24,2)+"x 10 24");
		    }
		    else if(tempR < 1.0E30 && tempR >= 1.0E27){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E-27,2)+" \u00d7 10","27","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E-27,2)+"x 10 27");
		    }
		    else if(tempR >= 1.0E30){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E-30,2)+" \u00d7 10","30","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E-30,2)+"x 10 30");
		    }
		    else if(tempR < 1.0E-3 && tempR >= 1.0E-6){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E6,2)+" \u00d7 10","-6","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E6,2)+"x 10 -6");
		    }
		    else if(tempR < 1.0E-6 && tempR >= 1.0E-9){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E9,2)+" \u00d7 10","-9","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E9,2)+"x 10 -9");
		    }
		    else if(tempR < 1.0E-9 && tempR >= 1.0E-12){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E12,2)+" \u00d7 10","-12","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E12,2)+"x 10 -12");
		    }
		    else if(tempR < 1.0E-12 && tempR >= 1.0E-15){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E15,2)+" \u00d7 10","-15","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E15,2)+"x 10 -15");
		    }
		    else if(tempR < 1.0E-15 && tempR >= 1.0E-18){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E18,2)+" \u00d7 10","-18","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E18,2)+"x 10 -18");
		    }
		    else if(tempR < 1.0E-18 && tempR >= 1.0E-21){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E21,2)+" \u00d7 10","-21","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E21,2)+"x 10 -21");
		    }
		    else if(tempR < 1.0E-21 && tempR >= 1.0E-24){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E24,2)+" \u00d7 10","-24","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E24,2)+"x 10 -24");
		    }
                    else if(tempR < 1.0E-24 && tempR >= 1.0E-27){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E27,2)+" \u00d7 10","-27","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E27,2)+"x 10 -27");
		    }
                    else if(tempR < 1.0E-27 && tempR >= 1.0E-30){
			MaestroG.superscripter("  = "+MaestroA.rounder(tempR*1.0E30,2)+" \u00d7 10","-30","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = "+MaestroA.rounder(tempR*1.0E30,2)+"x 10 -30");
		    }
                    else if(tempR < 1.0E-30 && tempR != 0.0){
			MaestroG.superscripter("  = 0.0","","",g,fonto,xinit2,y);
			stepx = fm.stringWidth("  = 0.0");
		    }
		    
		    tempX = Math.abs(state.wave_impedance.Imaginary());
		    xinit3 = xinit2+stepx;
		    
		    if(tempX < 1.0E3 && tempX >= 1.0E-3){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX,6),"","",g,fonto,xinit3,y);
		    }
		    else if(tempX == 0.0){
			MaestroG.superscripter(" + j 0.0","","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E6 && tempX >= 1.0E3){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-3,2)+" \u00d7 10","3","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E9 && tempX >= 1.0E6){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-6,2)+" \u00d7 10","6","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E12 && tempX >= 1.0E9){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-9,2)+" \u00d7 10","9","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E15 && tempX >= 1.0E12){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-12,2)+" \u00d7 10","12","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E18 && tempX >= 1.0E15){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-15,2)+" \u00d7 10","15","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E21 && tempX >= 1.0E18){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-18,2)+" \u00d7 10","18","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E24 && tempX >= 1.0E21){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-21,2)+" \u00d7 10","21","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E27 && tempX >= 1.0E24){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-24,2)+" \u00d7 10","24","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E30 && tempX >= 1.0E27){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-27,2)+" \u00d7 10","27","",g,fonto,xinit3,y);
		    }
		    else if(tempX >= 1.0E30){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-30,2)+" \u00d7 10","30","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E-3 && tempX >= 1.0E-6){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E6,2)+" \u00d7 10","-6","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E-6 && tempX >= 1.0E-9){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E9,2)+" \u00d7 10","-9","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E-9 && tempX >= 1.0E-12){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E12,2)+" \u00d7 10","-12","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E-12 && tempX >= 1.0E-15){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E15,2)+" \u00d7 10","-15","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E-15 && tempX >= 1.0E-18){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E18,2)+" \u00d7 10","-18","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E-18 && tempX >= 1.0E-21){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E21,2)+" \u00d7 10","-21","",g,fonto,xinit3,y);
		    }
		    else if(tempX < 1.0E-21 && tempX >= 1.0E-24){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E24,2)+" \u00d7 10","-24","",g,fonto,xinit3,y);
		    }
                    else if(tempX < 1.0E-24 && tempX >= 1.0E-27){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E27,2)+" \u00d7 10","-27","",g,fonto,xinit3,y);
		    }
                    else if(tempX < 1.0E-27 && tempX >= 1.0E-30){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E30,2)+" \u00d7 10","-30","",g,fonto,xinit3,y);
		    }
                    else if(tempX < 1.0E-30 && tempX != 0.0){
			MaestroG.superscripter(sign+" 0.0","","",g,fonto,xinit3,y);
		    }

            
            
            y += dy;
           	    
		    tempR = Complex.Magnitude(state.wave_impedance);
                    double dtmp2;
     
                    if(tempR == 0.0){dtmp2 = 0.0;}
                    else{dtmp2=MaestroA.rounder(state.wave_impedance.Arg2(),4);}
                
                    		    
		    if(tempR < 1.0E3 && tempR >= 1.0E-3){
                        MaestroG.SansMiditalic("  = "+MaestroA.rounder(tempR,6),"  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR == 0.0){
			MaestroG.SansMiditalic("  = 0.0","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E6 && tempR >= 1.0E3){
                        MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-3,2)+" \u00d7 10","3","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E9 && tempR >= 1.0E6){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-6,2)+" \u00d7 10","6","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E12 && tempR >= 1.0E9){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-9,2)+" \u00d7 10","9","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E15 && tempR >= 1.0E12){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-12,2)+" \u00d7 10","12","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E18 && tempR >= 1.0E15){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-15,2)+" \u00d7 10","15","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E21 && tempR >= 1.0E18){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-18,2)+" \u00d7 10","18","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E24 && tempR >= 1.0E21){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-21,2)+" \u00d7 10","21","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E27 && tempR >= 1.0E24){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-24,2)+" \u00d7 10","24","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E30 && tempR >= 1.0E27){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-27,2)+" \u00d7 10","27","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR >= 1.0E30){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-30,2)+" \u00d7 10","30","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-3 && tempR >= 1.0E-6){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E6,2)+" \u00d7 10","-6","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-6 && tempR >= 1.0E-9){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E9,2)+" \u00d7 10","-9","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-9 && tempR >= 1.0E-12){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E12,2)+" \u00d7 10","-12","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-12 && tempR >= 1.0E-15){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E15,2)+" \u00d7 10","-15","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-15 && tempR >= 1.0E-18){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E18,2)+" \u00d7 10","-18","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-18 && tempR >= 1.0E-21){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E21,2)+" \u00d7 10","-21","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-21 && tempR >= 1.0E-24){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E24,2)+" \u00d7 10","-24","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
                    else if(tempR < 1.0E-24 && tempR >= 1.0E-27){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E27,2)+" \u00d7 10","-27","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
                    else if(tempR < 1.0E-27 && tempR >= 1.0E-30){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E30,2)+" \u00d7 10","-30","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
                    else if(tempR < 1.0E-30 && tempR != 0.0){
			MaestroG.SansMiditalic("  = 0.0","  \u2220 ",""+dtmp2+" rad",g,fonto,xinit2,y);
		    }
            
                    y += dy;
           	    
		    tempR = Complex.Magnitude(state.wave_impedance);
                         
                    if(tempR == 0.0){dtmp2 = 0.0;}
                    else{dtmp2=MaestroA.rounder(state.wave_impedance.Arg2()*180/Math.PI,4);}
                
                    		    
		    if(tempR < 1.0E3 && tempR >= 1.0E-3){
                        MaestroG.SansMiditalic("  = "+MaestroA.rounder(tempR,6),"  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR == 0.0){
			MaestroG.SansMiditalic("  = 0.0","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E6 && tempR >= 1.0E3){
                        MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-3,2)+" \u00d7 10","3","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E9 && tempR >= 1.0E6){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-6,2)+" \u00d7 10","6","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E12 && tempR >= 1.0E9){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-9,2)+" \u00d7 10","9","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E15 && tempR >= 1.0E12){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-12,2)+" \u00d7 10","12","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E18 && tempR >= 1.0E15){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-15,2)+" \u00d7 10","15","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E21 && tempR >= 1.0E18){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-18,2)+" \u00d7 10","18","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E24 && tempR >= 1.0E21){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-21,2)+" \u00d7 10","21","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E27 && tempR >= 1.0E24){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-24,2)+" \u00d7 10","24","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E30 && tempR >= 1.0E27){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-27,2)+" \u00d7 10","27","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR >= 1.0E30){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E-30,2)+" \u00d7 10","30","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-3 && tempR >= 1.0E-6){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E6,2)+" \u00d7 10","-6","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-6 && tempR >= 1.0E-9){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E9,2)+" \u00d7 10","-9","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-9 && tempR >= 1.0E-12){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E12,2)+" \u00d7 10","-12","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-12 && tempR >= 1.0E-15){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E15,2)+" \u00d7 10","-15","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-15 && tempR >= 1.0E-18){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E18,2)+" \u00d7 10","-18","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-18 && tempR >= 1.0E-21){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E21,2)+" \u00d7 10","-21","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
		    else if(tempR < 1.0E-21 && tempR >= 1.0E-24){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E24,2)+" \u00d7 10","-24","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
                    else if(tempR < 1.0E-24 && tempR >= 1.0E-27){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E27,2)+" \u00d7 10","-27","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
                    else if(tempR < 1.0E-27 && tempR >= 1.0E-30){
			MaestroG.SansMiditalicSuper("  = "+MaestroA.rounder(tempR*1.0E30,2)+" \u00d7 10","-30","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
                    else if(tempR < 1.0E-30 && tempR != 0.0){
			MaestroG.SansMiditalic("  = 0.0","  \u2220 ",""+dtmp2+" \u00ba",g,fonto,xinit2,y);
		    }
            
            //-----------------------------------------------------------------------------------
            //g.drawLine(5,y,getSize().width-5,y); 
	    g.setColor(Color.red.darker());
	    y += dyy;
	    g.drawString("Penetration (Skin) Depth",x,y);
	    y+= dy;
	    g.setColor(Color.black);
	    temp2 = state.skin_depth;
            
            g.setFont(symbolfont);
            MaestroG.subscripterSymFirst2("\u03b4","s","",g,fonto_delta,x+dxx-3,y);
            g.setFont(normalfont);
                    
	    if(state.skin_depth > 2.0e140){
		
                //MaestroG.subscripterInfinityTwo("  = ","","",""," [ m ]",g,fonto,xinit2,y); 
		MaestroG.subscripterInfinityTwo("  = ","","","","",g,fonto,xinit2,y); 
		
                g.setFont(normalfont);
	    }
	    
            //------------------------------------------------------------------       
            else{
                String newtemp;
                if(state.skin_depth/state.wavelength > 1000.0){
                    newtemp =""+(int)(state.skin_depth/state.wavelength);
                }
                else{
                    newtemp =""+MaestroA.rounder(state.skin_depth/state.wavelength,4);
                }
                    //g.setFont(symbolfont);
                    //MaestroG.subscripterSymFirst2("\u03b4","","z",g,fonto,x+dxx,y);
                    //g.setFont(normalfont);
                    
                    if(temp2 >= 1.0E15 && state.frequency > 0.0){
			temp = temp2/1.0E12;
			//MaestroG.superscripter("  =  "+newtemp+"  =  "+temp+"   [ m ]","","",g,fonto,xinit2,y); 
                        MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+"   [ 10","9"," km ]",g,fonto,xinit2,y);
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ Tm ]",xinit2,y); 
		    }
		    
		    else if(temp2 < 1.0e15 && temp2 >= 1.0E12){
			temp = temp2/1.0E12;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+"   [ 10","9"," km ]",g,fonto,xinit2,y); 
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ Tm ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0e12 && temp2 >= 1.0e9){
			temp = temp2/1.0E9;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+"   [ 10","6"," km ]",g,fonto,xinit2,y);   
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ Gm ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0e9 && temp2 >= 1.0e6){
			temp = temp2/1.0E6; 
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+"   [ 10","3"," km ]",g,fonto,xinit2,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ Mm ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E6 && temp2 >= 1.0E3){
			temp = temp2/1.0E3;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+"   [ km ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp,5)+"   [ km ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E3 && temp2 >= 1.0){
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp2,5)+"   [ m ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp2,5)+"   [ m ]",xinit2,y); 
		    }
		    else if(temp2 <1.0 && temp2 >= 1.0E-2){
			temp = temp2*1.0E2;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+"   [ cm ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp,5)+"   [ cm ]",xinit2,y); 
		    }
		    else if(temp2 <1.0E-2 && temp2 >= 1.0E-4){
			temp = temp2*1.0E3;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+"   [ mm ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp,5)+"   [ mm ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E-4 && temp2 >=1.0E-6 ){
			temp = temp2*1.0E6;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+"   [ \u00b5 m ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp,5)+"   [ \u00b5 m ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E-6 && temp2 >=1.0E-9){
			temp = temp2*1.0E9;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+"   [ nm ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp,5)+"   [ nm ]",xinit2,y); 
		    }	
		    else if(temp2 < 1.0E-9 && temp2 >=1.0E-12){
			temp = temp2*1.0E12;
			MaestroG.superscripter("  =  "+newtemp+"  =  "+MaestroA.rounder(temp,5)+"   [ 10","-12","  m ]",g,fonto,xinit2,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ pm ]",xinit2,y); 
		    }	   
		    else if(temp2 < 1.0E-12 && temp2 >=1.0E-15){
			temp = temp2*1.0E15;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+"   [ 10","-15","  m ]",g,fonto,xinit2,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ fm ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E-15 && temp2 >=1.0e-18){
			temp = temp2*1.0E18;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+"   [ 10","-18","  m ]",g,fonto,xinit2,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ am ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E-18 && temp2 >=1.0E-21){
			temp = temp2*1.0E21;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+"   [ 10","-21","  m ]",g,fonto,xinit2,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ fm ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E-21 && temp2 > 0.0){
			temp = temp2;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+temp+" [m]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ fm ]",xinit2,y); 
		    }
			       
		    else if(temp2 == 0.0){
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp2,5)+"   [ m ]","","",g,fonto,xinit2,y);  
                        //g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp2,8)+"   [ m ]",xinit2,y); 
		    }
            }
            
            
            //------------------------------------------------------------------
	    
	    //g.drawLine(5,y,getSize().width-5,y); 
	    y += dyy;
	    g.setColor(Color.red.darker());
	    g.drawString("Phase and Attenuation Constants",x,y);
	    y += dy;
	    g.setColor(Color.black);
		MaestroG.superscripter(" [ m","-1"," ]",g,fonto,x+dxx+150,y);
	    
	    
	    
	    
	    if(state.beta < 1.0e-15){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e16,5)+"  \u00d7  10","-16"," ",g,fonto,xinit2,y);
	    }
            if(state.beta >= 1.0e-15 && state.beta < 1.0e-14){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e15,5)+"  \u00d7  10","-15"," ",g,fonto,xinit2,y);
	    }
            if(state.beta >= 1.0e-14 && state.beta < 1.0e-13){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e14,5)+"  \u00d7  10","-14"," ",g,fonto,xinit2,y);
	    }
            if(state.beta >= 1.0e-13 && state.beta < 1.0e-12){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e13,5)+"  \u00d7  10","-13"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e-12 && state.beta < 1.0e-11){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e12,5)+"  \u00d7  10","-12"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e-11 && state.beta < 1.0e-10){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e11,5)+"  \u00d7  10","-11"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e-10 && state.beta < 1.0e-9){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e10,5)+"  \u00d7  10","-10"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e-9 && state.beta < 1.0e-8){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e9,5)+"  \u00d7  10","-9"," ",g,fonto,xinit2,y);
	    }
	    
	    if(state.beta >= 1.0e-8 && state.beta < 1.0e-7){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e8,5)+"  \u00d7  10","-8"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e-7 && state.beta < 1.0e-6){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e7,5)+"  \u00d7  10","-7"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e-6 && state.beta < 1.0e-5){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e6,5)+"  \u00d7  10","-6"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e-5 && state.beta < 1.0e-4){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e5,5)+"  \u00d7  10","-5"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e-4 && state.beta < 1.0e-3){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e4,5)+"  \u00d7  10","-4"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e-3 && state.beta < 1.0e-2){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e3,5)+"  \u00d7  10","-3"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e-2 && state.beta < 1.0e-1){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e2,5)+"  \u00d7  10","-2"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e-1 && state.beta < 1.0){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e1,5)+"  \u00d7  10","-1"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0 && state.beta < 1.0e1){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta,5)+"  ",""," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e1 && state.beta < 1.0e2){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta,5)+"  ",""," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e2 && state.beta < 1.0e3){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-2,5)+"  \u00d7  10","2"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e3 && state.beta < 1.0e4){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-3,5)+"  \u00d7  10","3"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e4 && state.beta < 1.0e5){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-4,5)+"  \u00d7  10","4"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e5 && state.beta < 1.0e6){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-5,5)+"  \u00d7  10","5"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e6 && state.beta < 1.0e7){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-6,5)+"  \u00d7  10","6"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e7 && state.beta < 1.0e8){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-7,5)+"  \u00d7  10","7"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e8 && state.beta < 1.0e9){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-8,5)+"  \u00d7  10","8"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e9 && state.beta < 1.0e10){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-9,5)+"  \u00d7  10","9"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e10 && state.beta < 1.0e11){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-10,5)+"  \u00d7  10","10"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e11 && state.beta < 1.0e12){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-11,5)+"  \u00d7  10","11"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e12 && state.beta < 1.0e13){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-12,5)+"  \u00d7  10","12"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e13 && state.beta < 1.0e14){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-13,5)+"  \u00d7  10","13"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e14 && state.beta < 1.0e15){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-14,5)+"  \u00d7  10","14"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e15 && state.beta < 1.0e16){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-15,5)+"  \u00d7  10","15"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e16 && state.beta < 1.0e17){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-16,5)+"  \u00d7  10","16"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e17 && state.beta < 1.0e18){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-17,5)+"  \u00d7  10","17"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e18 && state.beta < 1.0e19){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-18,5)+"  \u00d7  10","18"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e19 && state.beta < 1.0e20){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-19,5)+"  \u00d7  10","19"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e20 && state.beta < 1.0e21){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.beta*1.0e-20,5)+"  \u00d7  10","20"," ",g,fonto,xinit2,y);
	    }
	    if(state.beta >= 1.0e21){
		MaestroG.superscripter("  =  "+state.beta+"",""," ",g,fonto,xinit2,y);
	    }
	    
	    g.setFont(symbolfont);
	    g.drawString("\u03b2",x+dxx,y);
	    g.setFont(normalfont);
	    
	    y += dy;
	    g.setColor(Color.black);
	    g.drawString(" [ Ne / m ]",x+dxx+150,y);
	    //g.drawString("     =  "+MaestroA.rounder(state.alpha,15),x+dxx,y);
	    if(state.alpha == 0.0){
                g.drawString("  =  "+MaestroA.rounder(state.alpha,15),xinit2,y);
            }
            if(state.alpha < 1.0e-20 && state.alpha > 0.0){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e21,5)+"  \u00d7  10","-21"," ",g,fonto,xinit2,y);
	    }
            if(state.alpha >= 1.0e-20 && state.alpha < 1.0e-19){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e20,5)+"  \u00d7  10","-20"," ",g,fonto,xinit2,y);
	    }
            if(state.alpha >= 1.0e-19 && state.alpha < 1.0e-18){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e19,5)+"  \u00d7  10","-19"," ",g,fonto,xinit2,y);
	    }
            if(state.alpha >= 1.0e-18 && state.alpha < 1.0e-17){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e18,5)+"  \u00d7  10","-18"," ",g,fonto,xinit2,y);
	    }
            if(state.alpha >= 1.0e-17 && state.alpha < 1.0e-16){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e17,5)+"  \u00d7  10","-17"," ",g,fonto,xinit2,y);
	    }
            if(state.alpha >= 1.0e-16 && state.alpha < 1.0e-15){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e16,5)+"  \u00d7  10","-16"," ",g,fonto,xinit2,y);
	    }
            if(state.alpha >= 1.0e-15 && state.alpha < 1.0e-14){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e15,5)+"  \u00d7  10","-15"," ",g,fonto,xinit2,y);
	    }
            if(state.alpha >= 1.0e-14 && state.alpha < 1.0e-13){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e14,5)+"  \u00d7  10","-14"," ",g,fonto,xinit2,y);
	    }
            if(state.alpha >= 1.0e-13 && state.alpha < 1.0e-12){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e13,5)+"  \u00d7  10","-13"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e-12 && state.alpha < 1.0e-11){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e12,5)+"  \u00d7  10","-12"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e-11 && state.alpha < 1.0e-10){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e11,5)+"  \u00d7  10","-11"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e-10 && state.alpha < 1.0e-9){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e10,5)+"  \u00d7  10","-10"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e-9 && state.alpha < 1.0e-8){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e9,5)+"  \u00d7  10","-9"," ",g,fonto,xinit2,y);
	    }
	    
	    if(state.alpha >= 1.0e-8 && state.alpha < 1.0e-7){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e8,5)+"  \u00d7  10","-8"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e-7 && state.alpha < 1.0e-6){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e7,5)+"  \u00d7  10","-7"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e-6 && state.alpha < 1.0e-5){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e6,5)+"  \u00d7  10","-6"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e-5 && state.alpha < 1.0e-4){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e5,5)+"  \u00d7  10","-5"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e-4 && state.alpha < 1.0e-3){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e4,5)+"  \u00d7  10","-4"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e-3 && state.alpha < 1.0e-2){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e3,5)+"  \u00d7  10","-3"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e-2 && state.alpha < 1.0e-1){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e2,5)+"  \u00d7  10","-2"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e-1 && state.alpha < 1.0){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e1,5)+"  \u00d7  10","-1"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0 && state.alpha < 1.0e1){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha,5)+"  ",""," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e1 && state.alpha < 1.0e2){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha,5)+"  ",""," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e2 && state.alpha < 1.0e3){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-2,5)+"  \u00d7  10","2"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e3 && state.alpha < 1.0e4){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-3,5)+"  \u00d7  10","3"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e4 && state.alpha < 1.0e5){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-4,5)+"  \u00d7  10","4"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e5 && state.alpha < 1.0e6){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-5,5)+"  \u00d7  10","5"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e6 && state.alpha < 1.0e7){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-6,5)+"  \u00d7  10","6"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e7 && state.alpha < 1.0e8){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-7,5)+"  \u00d7  10","7"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e8 && state.alpha < 1.0e9){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-8,5)+"  \u00d7  10","8"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e9 && state.alpha < 1.0e10){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-9,5)+"  \u00d7  10","9"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e10 && state.alpha < 1.0e11){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-10,5)+"  \u00d7  10","10"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e11 && state.alpha < 1.0e12){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-11,5)+"  \u00d7  10","11"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e12 && state.alpha < 1.0e13){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-12,5)+"  \u00d7  10","12"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e13 && state.alpha < 1.0e14){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-13,5)+"  \u00d7  10","13"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e14 && state.alpha < 1.0e15){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-14,5)+"  \u00d7  10","14"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e15 && state.alpha < 1.0e16){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-15,5)+"  \u00d7  10","15"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e16 && state.alpha < 1.0e17){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-16,5)+"  \u00d7  10","16"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e17 && state.alpha < 1.0e18){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-17,5)+"  \u00d7  10","17"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e18 && state.alpha < 1.0e19){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-18,5)+"  \u00d7  10","18"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e19 && state.alpha < 1.0e20){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-19,5)+"  \u00d7  10","19"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e20 && state.alpha < 1.0e21){
		MaestroG.superscripter("  =  "+MaestroA.rounder(state.alpha*1.0e-20,5)+"  \u00d7  10","20"," ",g,fonto,xinit2,y);
	    }
	    if(state.alpha >= 1.0e21){
		MaestroG.superscripter("  =  "+state.alpha+"",""," ",g,fonto,xinit2,y);
	    }
	    
	    g.setFont(symbolfont);
	    g.drawString("\u03b1",x+dxx,y);
	    g.setFont(normalfont);
	    
	    
	    
            g.setColor(Color.black);
            //g.drawRect(10,y+7,getSize().width-25,38);
            g.drawLine(5,y+10,getSize().width-5,y+10); 
            
            y += dyy + 10;
	    g.setColor(Color.red.darker());
	    
	    g.setFont(symbolfont);
	    g.drawString("\u03c3 / \u03c9\u03b5",x-5,y);
	    g.setFont(normalfont);
	    
	    
	    g.setColor(Color.black);
	    temp = state.conductivity/2.0/Math.PI/state.frequency/state.epsilon0/state.epsilon_r;
	    
	    if(state.conductivity == 0.0){
		if( state.epsilon_r > 1.0){
		    g.drawString("  =  "+MaestroA.rounder(temp,8)+"",xinit2,y);
		    y+=dyy;
		    g.setColor(Color.magenta.darker());
		    g.drawString("The material is a perfect dielectric",x-5,y);
		}
		else{
		    g.drawString("  =  "+MaestroA.rounder(temp,8)+"",xinit2,y);
		    y+=dyy;
		    g.setColor(Color.magenta.darker());
		    g.drawString("The material is vacuum (perfect dielectric)",x-5,y);
		}
	    }
	    
	    
	    if(state.conductivity != 0.0){
		if(temp >= 100.0){
		    //g.drawString("  =  "+MaestroA.rounder(temp,8)+"   >> 1",xinit2,y);
                    
                    //----------------------------------------------------------
                    
                    if(temp <= 1.0E2 && temp > 1.0e1){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp,5)+"","","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E3 && temp > 1.0e2){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-2,5)+"  \u00d7  10","2","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E4 && temp > 1.0e3){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-3,5)+"  \u00d7  10","3","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E5 && temp > 1.0e4){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-4,5)+"  \u00d7  10","4","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E6 && temp > 1.0e5){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-5,5)+"  \u00d7  10","5","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E7 && temp > 1.0e6){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-6,5)+"  \u00d7  10","6","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E8 && temp > 1.0e7){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-7,5)+"  \u00d7  10","7","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E9 && temp > 1.0e8){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-8,5)+"  \u00d7  10","8","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E10 && temp > 1.0e9){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-9,5)+"  \u00d7  10","9","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E11 && temp > 1.0e10){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-10,5)+"  \u00d7  10","10","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E12 && temp > 1.0e11){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-11,5)+"  \u00d7  10","11","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E13 && temp > 1.0e12){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-12,5)+"  \u00d7  10","12","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E14 && temp > 1.0e13){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-13,5)+"  \u00d7  10","13","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E15 && temp > 1.0e14){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-14,5)+"  \u00d7  10","14","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E16 && temp > 1.0e15){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-15,5)+"  \u00d7  10","15","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E17 && temp > 1.0e16){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-16,5)+"  \u00d7  10","16","   >> 1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E18 && temp > 1.0e17){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-17,5)+"  \u00d7  10","17","   >> 1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E19 && temp > 1.0e18){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-18,5)+"  \u00d7  10","18","   >> 1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E20 && temp > 1.0e19){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-19,5)+"  \u00d7  10","19","   >> 1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E21 && temp > 1.0e20){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-20,5)+"  \u00d7  10","20","   >> 1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E22 && temp > 1.0e21){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-21,5)+"  \u00d7  10","21","   >> 1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E23 && temp > 1.0e22){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-22,5)+"  \u00d7  10","22","   >> 1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E24 && temp > 1.0e23){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-23,5)+"  \u00d7  10","23","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E27 && temp > 1.0e24){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-24,5)+"  \u00d7  10","24","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E30 && temp > 1.0e27){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-27,5)+"  \u00d7  10","27","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0E33 && temp > 1.0e30){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-30,5)+"  \u00d7  10","30","   >>  1",g,fonto,xinit2,y);
                    }
                    else if(temp > 1.0e33){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0E-33,5)+"  \u00d7  10","33","   >>  1",g,fonto,xinit2,y);
                    }
                    //----------------------------------------------------------
                    
		    y+=dyy;
		    g.setColor(Color.magenta.darker());
		    g.drawString("The material is a good conductor",x-5,y);
		}
		if(temp <= 0.01 ){
                    if(temp <= 0.1 && temp > 1.0e-2){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e2,5)+"  \u00d7  10","-2","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-2 && temp > 1.0e-3){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e3,5)+"  \u00d7  10","-3","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-3 && temp > 1.0e-4){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e4,5)+"  \u00d7  10","-4","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-4 && temp > 1.0e-5){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e5,5)+"  \u00d7  10","-5","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-5 && temp > 1.0e-6){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e6,5)+"  \u00d7  10","-6","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-6 && temp > 1.0e-7){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e7,5)+"  \u00d7  10","-7","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-7 && temp > 1.0e-8){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e8,5)+"  \u00d7  10","-8","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-8 && temp > 1.0e-9){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e9,5)+"  \u00d7  10","-9","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-9 && temp > 1.0e-10){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e10,5)+"  \u00d7  10","-10","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-10 && temp > 1.0e-11){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e11,5)+"  \u00d7  10","-11","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-11 && temp > 1.0e-12){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e12,5)+"  \u00d7  10","-12","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-12 && temp > 1.0e-13){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e13,5)+"  \u00d7  10","-13","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-13 && temp > 1.0e-14){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e14,5)+"  \u00d7  10","-14","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-14 && temp > 1.0e-15){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e15,5)+"  \u00d7  10","-15","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-15 && temp > 1.0e-16){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e16,5)+"  \u00d7  10","-16","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-16 && temp > 1.0e-17){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e17,5)+"  \u00d7  10","-17","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-17 && temp > 1.0e-18){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e18,5)+"  \u00d7  10","-18","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-18 && temp > 1.0e-19){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e19,5)+"  \u00d7  10","-19","   <<  1",g,fonto,xinit2,y);
                    }
                    else if(temp <= 1.0e-19){
                        MaestroG.superscripter("  =  "+MaestroA.rounder(temp*1.0e20,5)+"  \u00d7  10","-20","   <<  1",g,fonto,xinit2,y);
                    }
                    y+=dyy;
		    g.setColor(Color.magenta.darker());
		    g.drawString("The material is an imperfect dielectric",x-5,y);
		}
	    
		if(temp > 0.01 && temp  < 100.0){
		    g.drawString("  =  "+MaestroA.rounder(temp,5)+"",xinit2,y);
		    y+=dyy;
		    g.setColor(Color.magenta.darker());
		    g.drawString("0.01 < (\u03c3 / \u03c9\u03b5) < 100.0   General medium",x-5,y);
		}
	     }
	} 
}

class PlaneWaveOutputCanvasB extends Canvas{
	private static final Font normalfont = new Font("SanSerif",Font.PLAIN,12);
	private static final Font subfont    = new Font("SanSerif",Font.PLAIN,10);
	PlaneWave_State state;
	
        private Image im;
	private Graphics buf;

        public PlaneWaveOutputCanvasB(PlaneWave_State state){
	    super();
	    this.state = state;
	}
	
        public void paint(Graphics g){
	    if(im == null){
		im = createImage(getSize().width,getSize().height);
		buf = im.getGraphics();
		drawGraph(buf);
	    }
	    else{
		drawGraph(buf);
	    }
	    g.drawImage(im,0,0,null);
	}
	
	//Addition to reduce flicker new routine
	public void update(Graphics g){		// added to avoid clearing
	    paint(g);
	}

	public void drawGraph(Graphics g){
	    int x, y, dx, dxx, dy, dyy, xinit2, xshift1, xshift2, xshift3, fonto;
	    double v_normalized, SA, SB, PA, PB, Pdiff;
	    String unita;
            Graphics2D g2d = (Graphics2D)g;
            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
            
            g.clearRect(0,0,getSize().width,getSize().height);
	    
            int startx = 12;
            
            g.setColor(Color.gray);
            MaestroG.subscripterBold("Output","","",g,14,startx+1,startx+6);
            g.setColor(Color.red.darker());
            MaestroG.subscripterBold("Output","","",g,14,startx,startx+5);
            
            
            FontMetrics fm;
	    x = 10;
	    y = 10+40;
	    dx = 80;
	    dxx = 15;
            
            xshift1 = 40;
            xshift2 = 50;
            xshift3 = 5;
            
            fonto = 12;
            
	    g.setFont(normalfont);
	    fm = g.getFontMetrics();
	    dy = fm.getHeight()+4;
	    dyy = dy+10;
            
            double temp, temp2;
	    temp2 = state.zpos[0]*state.wavelength;
            temp = temp2;
            int stringo;
            int xnew = 10;
            int xshift = 20;
            
            stringo = fm.stringWidth("z = "+MaestroA.rounder(state.zpos[0],6)+" \u03bb  ");
            MaestroG.subscripterSanSym2("z",""," = "+MaestroA.rounder(state.zpos[0],6)," \u03bb",g,fonto,x+xnew,y);
            //y += dy;         
            xnew = x + xnew + stringo;
                    if(temp2 >= 1.0E12){
			temp = temp2/1.0E12;
			MaestroG.superscripter(" = "+MaestroA.rounder(temp,1)+" \u00d7 10","9"," [ km ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0e12 && temp2 >= 1.0e9){
			temp = temp2/1.0E9;
                        MaestroG.superscripter(" = "+MaestroA.rounder(temp,1)+" \u00d7 10","6"," [ km ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0e9 && temp2 >= 1.0e6){
			temp = temp2/1.0E6;
                        MaestroG.superscripter(" = "+MaestroA.rounder(temp,1)+" \u00d7 10","3"," [ km ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0E6 && temp2 >= 1.0E3){
			temp = temp2/1.0E3;
                        MaestroG.superscripter(" = "+MaestroA.rounder(temp,3),""," [ km ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0E3 && temp2 >= 1.0){
                        MaestroG.superscripter(" = "+MaestroA.rounder(temp,5),""," [ m ]",g,fonto,xnew,y);
		    }
		    else if(temp2 <1.0 && temp2 >= 1.0E-2){
			temp = temp2*1.0E2;
                        MaestroG.superscripter(" = "+MaestroA.rounder(temp,5),""," [ cm ]",g,fonto,xnew,y);
		    }
		    else if(temp2 <1.0E-2 && temp2 >= 1.0E-4){
			temp = temp2*1.0E3;
                        MaestroG.superscripter(" = "+MaestroA.rounder(temp,5),""," [ mm ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0E-4 && temp2 >=1.0E-6 ){
			temp = temp2*1.0E6;
                        MaestroG.superscripter(" = "+MaestroA.rounder(temp,5),""," [ \u00b5 m ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0E-6 && temp2 >=1.0E-9){
			temp = temp2*1.0E9;
                        MaestroG.superscripter(" = "+MaestroA.rounder(temp,5),""," [ nm ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0E-9 && temp2 >=1.0E-12){
			temp = temp2*1.0E12;
                        MaestroG.superscripter(" = "+MaestroA.rounder(temp,5)+" \u00d7 10","-3"," [ nm ]",g,fonto,xnew,y);
		    }	   
		    else if(temp2 < 1.0E-12 && temp2 >=1.0E-15){
			temp = temp2*1.0E15;
			MaestroG.superscripter(" = "+MaestroA.rounder(temp,5)+" \u00d7 10","-6"," [ nm ]",g,fonto,xnew,y);
                    }
		    else if(temp2 < 1.0E-15 && temp2 > 0.0){
			temp = temp2*1.0E18;
                        MaestroG.superscripter(" = "+MaestroA.rounder(temp,5)+" \u00d7 10","-9"," [ nm ]",g,fonto,xnew,y);
		    }
		    else if(temp2 == 0.0){
                        MaestroG.superscripter(" = "+MaestroA.rounder(temp2,3),""," [ m ]",g,fonto,xnew,y);
		    }
            

            y += dy;
	    x =10;
            xnew = 10;
            
            temp2 = state.total_length*state.wavelength;
            temp = temp2;
            
            stringo = fm.stringWidth("L = "+MaestroA.rounder(state.total_length,6)+" \u03bb ");
            MaestroG.subscripterSansItalic6("h",""," = "+MaestroA.rounder(state.total_length,6)+" ","\u03bb",g,fonto,x+xnew,y);
            xnew = x + xnew + stringo;
                    if(temp2 >= 1.0E12){
			temp = temp2/1.0E12;
			MaestroG.superscripter("  = "+MaestroA.rounder(temp,1)+" \u00d7 10","9"," [ km ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0e12 && temp2 >= 1.0e9){
			temp = temp2/1.0E9;
                        MaestroG.superscripter("  = "+MaestroA.rounder(temp,1)+" \u00d7 10","6"," [ km ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0e9 && temp2 >= 1.0e6){
			temp = temp2/1.0E6;
                        MaestroG.superscripter("  = "+MaestroA.rounder(temp,1)+" \u00d7 10","3"," [ km ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0E6 && temp2 >= 1.0E3){
			temp = temp2/1.0E3;
                        MaestroG.superscripter("  = "+MaestroA.rounder(temp,3),""," [ km ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0E3 && temp2 >= 1.0){
                        MaestroG.superscripter("  = "+MaestroA.rounder(temp,5),""," [ m ]",g,fonto,xnew,y);
		    }
		    else if(temp2 <1.0 && temp2 >= 1.0E-2){
			temp = temp2*1.0E2;
                        MaestroG.superscripter("  = "+MaestroA.rounder(temp,5),""," [ cm ]",g,fonto,xnew,y);
		    }
		    else if(temp2 <1.0E-2 && temp2 >= 1.0E-4){
			temp = temp2*1.0E3;
                        MaestroG.superscripter("  = "+MaestroA.rounder(temp,5),""," [ mm ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0E-4 && temp2 >=1.0E-6 ){
			temp = temp2*1.0E6;
                        MaestroG.superscripter("  = "+MaestroA.rounder(temp,5),""," [ \u00b5 m ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0E-6 && temp2 >=1.0E-9){
			temp = temp2*1.0E9;
                        MaestroG.superscripter("  = "+MaestroA.rounder(temp,5),""," [ nm ]",g,fonto,xnew,y);
		    }
		    else if(temp2 < 1.0E-9 && temp2 >=1.0E-12){
			temp = temp2*1.0E12;
                        MaestroG.superscripter("  = "+MaestroA.rounder(temp,5)+" \u00d7 10","-3"," [ nm ]",g,fonto,xnew,y);
		    }	   
		    else if(temp2 < 1.0E-12 && temp2 >=1.0E-15){
			temp = temp2*1.0E15;
			MaestroG.superscripter("  = "+MaestroA.rounder(temp,5)+" \u00d7 10","-6"," [ nm ]",g,fonto,xnew,y);
                    }
		    else if(temp2 < 1.0E-15 && temp2 > 0.0){
			temp = temp2*1.0E18;
                        MaestroG.superscripter("  = "+MaestroA.rounder(temp,5)+" \u00d7 10","-9"," [ nm ]",g,fonto,xnew,y);
		    }
		    else if(temp2 == 0.0){
                        MaestroG.superscripter("  = "+MaestroA.rounder(temp2,3),""," [ m ]",g,fonto,xnew,y);
		    }    
            
            //---------------------------------------------------------------
            y+= dy;
	    g.setColor(Color.black);
	    temp2 = state.skin_depth;
            x = 10;
            xnew = 10; 
            
            MaestroG.subscripterSymFirst2("\u03b4","s","",g,14,x+xnew,y);
            stringo = fm.stringWidth("ds ");
            xinit2 = x + xnew + stringo;
            
	    if(state.skin_depth > 2.0e140){
                MaestroG.subscripterInfinityTwo("  = ","","","","",g,fonto,xinit2,y); 
	    }
            else{
                String newtemp;
                if(state.skin_depth/state.wavelength > 1000.0){
                    newtemp =""+(int)(state.skin_depth/state.wavelength);
                }
                else{
                    newtemp =""+MaestroA.rounder(state.skin_depth/state.wavelength,4);
                }
                    
                    if(temp2 >= 1.0E15 && state.frequency > 0.0){
			temp = temp2/1.0E12;
			//MaestroG.superscripter("  =  "+newtemp+"  =  "+temp+"   [ m ]","","",g,fonto,xinit2,y); 
                        MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+" [ 10","9"," km ]",g,fonto,xinit2,y);
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ Tm ]",xinit2,y); 
		    }
		    
		    else if(temp2 < 1.0e15 && temp2 >= 1.0E12){
			temp = temp2/1.0E12;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+" [ 10","9"," km ]",g,fonto,xinit2,y); 
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ Tm ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0e12 && temp2 >= 1.0e9){
			temp = temp2/1.0E9;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+" [ 10","6"," km ]",g,fonto,xinit2,y);   
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ Gm ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0e9 && temp2 >= 1.0e6){
			temp = temp2/1.0E6; 
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+" [ 10","3"," km ]",g,fonto,xinit2,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ Mm ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E6 && temp2 >= 1.0E3){
			temp = temp2/1.0E3;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+" [ km ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp,5)+"   [ km ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E3 && temp2 >= 1.0){
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp2,5)+" [ m ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp2,5)+"   [ m ]",xinit2,y); 
		    }
		    else if(temp2 <1.0 && temp2 >= 1.0E-2){
			temp = temp2*1.0E2;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+" [ cm ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp,5)+"   [ cm ]",xinit2,y); 
		    }
		    else if(temp2 <1.0E-2 && temp2 >= 1.0E-4){
			temp = temp2*1.0E3;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+" [ mm ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp,5)+"   [ mm ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E-4 && temp2 >=1.0E-6 ){
			temp = temp2*1.0E6;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+" [ \u00b5 m ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp,5)+"   [ \u00b5 m ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E-6 && temp2 >=1.0E-9){
			temp = temp2*1.0E9;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+" [ nm ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp,5)+"   [ nm ]",xinit2,y); 
		    }	
		    else if(temp2 < 1.0E-9 && temp2 >=1.0E-12){
			temp = temp2*1.0E12;
			MaestroG.superscripter("  =  "+newtemp+"  =  "+MaestroA.rounder(temp,5)+" [ 10","-12","  m ]",g,fonto,xinit2,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ pm ]",xinit2,y); 
		    }	   
		    else if(temp2 < 1.0E-12 && temp2 >=1.0E-15){
			temp = temp2*1.0E15;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+" [ 10","-15","  m ]",g,fonto,xinit2,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ fm ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E-15 && temp2 >=1.0e-18){
			temp = temp2*1.0E18;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+" [ 10","-18","  m ]",g,fonto,xinit2,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ am ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E-18 && temp2 >=1.0E-21){
			temp = temp2*1.0E21;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp,5)+" [ 10","-21","  m ]",g,fonto,xinit2,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ fm ]",xinit2,y); 
		    }
		    else if(temp2 < 1.0E-21 && temp2 > 0.0){
			temp = temp2;
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+temp+" [ m ]","","",g,fonto,xinit2,y);  
			//g.drawString("  =  "+MaestroA.rounder(temp,8)+"   [ fm ]",xinit2,y); 
		    }
			       
		    else if(temp2 == 0.0){
			MaestroG.superscripterinsert("  =  "+newtemp," \u03bb","  =  "+MaestroA.rounder(temp2,5)+" [ m ]","","",g,fonto,xinit2,y);  
                        //g.drawString("  =  "+newtemp+"  =  "+MaestroA.rounder(temp2,8)+"   [ m ]",xinit2,y); 
		    }
            }
            
            //---------------------------------------------------------------
                int xVec, yVec, i;
		String stmp1, stmp2;
		int cwidth=5;
	  	double Efield, Hfield, Ephase, Hphase;
                
                y +=dyy;
                g.setColor(Color.black);
                MaestroG.subscripter("Phasors","","",g,14,x,y);
                
                y += dy;
                g.setColor(Color.red);
                
                unita = "  [ V / m ]";
                Efield = state.Ex*Math.exp(-state.alpha*state.zpos[0]*state.wavelength);
                Ephase = -state.beta*state.zpos[0]*state.wavelength+state.Phix;
                
		MaestroG.subscripter("| E ( z )",""," |",g,fonto,x+xshift3,y);
                printdata(Efield,g,fonto,x+xshift2,y,unita);
                
                y+= dy+2;
                
                //MaestroG.subscripterPhase("E ( z )","","",g,fonto,x+xshift3,y);
                MaestroG.subscripter("\u2220 E ( z )","","",g,fonto,x+xshift3,y);
		MaestroG.subscripter("  =  ","",""+MaestroA.rounder(Ephase,5)+" [ rad ]",g,fonto,x+xshift2,y);
                
                y += dy+2;
                
                g.setColor(Color.blue);
                unita = "  [ A / m ]";
                Hfield = state.Hy*Math.exp(-state.alpha*state.zpos[0]*state.wavelength);
                Hphase = -state.beta*state.zpos[0]*state.wavelength+state.Phix-state.wave_impedance.Arg2();
                
                MaestroG.subscripter("| H ( z )",""," |",g,fonto,x+xshift3,y);
		printdata(Hfield,g,fonto,x+xshift2,y,unita);
                y+= dy+2;
                //MaestroG.subscripterPhase("H ( z )","","",g,fonto,x+xshift3,y);
                MaestroG.subscripter("\u2220 H ( z )","","",g,fonto,x+xshift3,y);
		MaestroG.subscripter("  =  ","",""+MaestroA.rounder(Hphase,5)+" [ rad ]",g,fonto,x+xshift2,y);
            
            
                double Jzero, Jzeta;
                Jzero = state.Ex*state.conductivity;
                Jzeta = state.conductivity * state.Ex*Math.exp(-state.alpha*state.zpos[0]*state.wavelength);
            //SA = state.Ex*state.Ex/(2.0*Complex.Magnitude(state.wave_impedance))
		//    *Math.cos(Complex.Arg1(state.wave_impedance))*Math.exp(-2.0*state.alpha*state.zpos[0]*state.wavelength);
	    
	    //------------------------------------------------------------------ Current
	    y += dy+5;
	    g.setColor(Color.black);
	    
            unita="[ A / m\u00b2 ]";
            MaestroG.subscripter("| J","0"," |",g,fonto,x+xshift2-30,y);
            printdata(Jzero,g,fonto,x+xshift2,y,unita);
	    
            y += dy+5;
	    MaestroG.subscripter("| J","x","( z ) |",g,fonto,x+xshift2-45,y);
            printdata(Jzeta,g,fonto,x+xshift2,y,unita);
	}
        
        public static void printdata(double power, Graphics g, int fonto, int xinit2, int y, String unita){
            if(power < 1.0e-15 && power != 0.0){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e16,5)+"  \u00d7  10","-16"," "+unita,g,fonto,xinit2,y);
	    }
            if(power == 0.0){
		MaestroG.superscripter("  =  0.0",""," "+unita,g,fonto,xinit2,y);
	    }
            if(power >= 1.0e-15 && power < 1.0e-14){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e15,5)+"  \u00d7  10","-15"," "+unita,g,fonto,xinit2,y);
	    }
            if(power >= 1.0e-14 && power < 1.0e-13){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e14,5)+"  \u00d7  10","-14"," "+unita,g,fonto,xinit2,y);
	    }
            if(power >= 1.0e-13 && power < 1.0e-12){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e13,5)+"  \u00d7  10","-13"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-12 && power < 1.0e-11){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e12,5)+"  \u00d7  10","-12"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-11 && power < 1.0e-10){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e11,5)+"  \u00d7  10","-11"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-10 && power < 1.0e-9){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e10,5)+"  \u00d7  10","-10"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-9 && power < 1.0e-8){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e9,5)+"  \u00d7  10","-9"," "+unita,g,fonto,xinit2,y);
	    }
	    
	    if(power >= 1.0e-8 && power < 1.0e-7){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e8,5)+"  \u00d7  10","-8"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-7 && power < 1.0e-6){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e7,5)+"  \u00d7  10","-7"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-6 && power < 1.0e-5){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e6,5)+"  \u00d7  10","-6"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-5 && power < 1.0e-4){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e5,5)+"  \u00d7  10","-5"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-4 && power < 1.0e-3){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e4,5)+"  \u00d7  10","-4"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-3 && power < 1.0e-2){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e3,5)+"  \u00d7  10","-3"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-2 && power < 1.0e-1){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e2,5)+"  \u00d7  10","-2"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-1 && power < 1.0){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e1,5)+"  \u00d7  10","-1"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0 && power < 1.0e1){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power,5)+"  ",""," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e1 && power < 1.0e2){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power,5)+"  ",""," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e2 && power < 1.0e3){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-2,5)+"  \u00d7  10","2"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e3 && power < 1.0e4){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-3,5)+"  \u00d7  10","3"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e4 && power < 1.0e5){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-4,5)+"  \u00d7  10","4"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e5 && power < 1.0e6){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-5,5)+"  \u00d7  10","5"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e6 && power < 1.0e7){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-6,5)+"  \u00d7  10","6"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e7 && power < 1.0e8){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-7,5)+"  \u00d7  10","7"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e8 && power < 1.0e9){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-8,5)+"  \u00d7  10","8"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e9 && power < 1.0e10){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-9,5)+"  \u00d7  10","9"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e10 && power < 1.0e11){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-10,5)+"  \u00d7  10","10"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e11 && power < 1.0e12){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-11,5)+"  \u00d7  10","11"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e12 && power < 1.0e13){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-12,5)+"  \u00d7  10","12"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e13 && power < 1.0e14){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-13,5)+"  \u00d7  10","13"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e14 && power < 1.0e15){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-14,5)+"  \u00d7  10","14"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e15 && power < 1.0e16){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-15,5)+"  \u00d7  10","15"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e16 && power < 1.0e17){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-16,5)+"  \u00d7  10","16"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e17 && power < 1.0e18){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-17,5)+"  \u00d7  10","17"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e18 && power < 1.0e19){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-18,5)+"  \u00d7  10","18"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e19 && power < 1.0e20){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-19,5)+"  \u00d7  10","19"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e20 && power < 1.0e21){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-20,5)+"  \u00d7  10","20"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e21){
		MaestroG.superscripter("  =  "+power+"",""," "+unita,g,fonto,xinit2,y);
	    }
        }
}

class PlaneWaveOutputCanvasC extends Canvas{
	private static final Font normalfont = new Font("SanSerif",Font.PLAIN,12);
	private static final Font subfont    = new Font("SanSerif",Font.PLAIN,10);
	PlaneWave_State state;
	
        private Image im;
	private Graphics buf;

        public PlaneWaveOutputCanvasC(PlaneWave_State state){
	    super();
	    this.state = state;
	}
	
        public void paint(Graphics g){
	    if(im == null){
		im = createImage(getSize().width,getSize().height);
		buf = im.getGraphics();
		drawGraph(buf);
	    }
	    else{
		drawGraph(buf);
	    }
	    g.drawImage(im,0,0,null);
	}
	
	//Addition to reduce flicker new routine
	public void update(Graphics g){		// added to avoid clearing
	    paint(g);
	}

	public void drawGraph(Graphics g){
	    int x, y, dx, dxx, dy, dyy, xinit2, xshift1, xshift2, xshift3, fonto;
	    double v_normalized, SA, SB, PA, PB, Pdiff;
	    String unita;
            Graphics2D g2d = (Graphics2D)g;
            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
            
            g.clearRect(0,0,getSize().width,getSize().height);
	    
            int startx = 12;
            
            g.setColor(Color.gray);
            MaestroG.subscripterBold("Output","","",g,14,startx+1,startx+6);
            g.setColor(Color.red.darker());
            MaestroG.subscripterBold("Output","","",g,14,startx,startx+5);
                      
            FontMetrics fm;
	    x = 10;
	    y = 50;
	    dx = 80;
	    dxx = 15;
            
            xshift1 = 40;
            xshift2 = 50;
            xshift3 = 5;
            
            fonto = 12;
            
	    g.setFont(normalfont);
	    fm = g.getFontMetrics();
	    dy = fm.getHeight()+3;
	    dyy = dy+4;
            
            double temp, temp2;
	    temp2 = state.zpos[0]*state.wavelength;
            temp = temp2;
            int stringo;
            int xnew = 10;
            int xshift = 20;
            
            temp2 = state.skin_depth;
            x = 10;
            xnew = 10; int xinit3;
            
            //---------------------------------------------------------------
                int xVec, yVec, i;
		String stmp1, stmp2;
		int cwidth=5;
	  	double Efield, Hfield, Ephase, Hphase;
                
                //y +=dyy;
                g.setColor(Color.blue.darker());
                MaestroG.subscripter("Impedance","","",g,13,x,y);
                
                y += dy;
                g.setColor(Color.red);
                
                
                //===============================================================            
                
                double tempR = 0.0; double tempX = 0.0;
                int fontonew = 14;
                int stepx; 
                
                String Ohm, infinity, plusj, minusj, sign, zunit;
		Ohm="\u03a9";
		infinity="\u221e";
		plusj =" + j ";
                minusj =" - j";
		//zunit ="[ \u03a9 /m\u00b2 ]";
                zunit ="[ \u03a9 ]";
                Complex tempc;
            
                g.setColor(Color.black); 
            	
                //MaestroG.subscripter("Z","S","",g,fontonew,x+dxx,y);
                MaestroG.superscripter("Z = R + j X = 0.0 - j (\u03c9 C)","-1","",g,fontonew,x+dxx,y);
                
                y +=dy;
                
                fm = g.getFontMetrics();
                xinit2 = x+dxx+fm.stringWidth("ZS ");
                
                if(state.SurfaceImpedance.Imaginary() == 0.0){
		    MaestroG.subscripterInfinityOne("= ","",""," "+zunit+"  (Open Circuit)",g,fontonew,xinit2,y);              
                    //g.drawString("\u2992  \u221E  (Open Circuit)",xinit2,y);              
      		}
		else{
                
                    tempR=0.0; tempX=0.0;
                    stepx = 0;
                    if(state.SurfaceImpedance.Real() < 0.0){sign = minusj;}
                    else{sign = plusj;}
                    if(state.ResistanceS == 0.0){tempR = 0.0;}
		    else{
			tempR = state.SurfaceImpedance.Real();
		    }
		    
		    if(tempR < 1.0E3 && tempR >= 1.0E-3){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR,6),"","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR,6));
		    }
		    else if(tempR == 0.0){
			MaestroG.superscripter("= 0.0","","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= 0.0 ");
		    }
		    else if(tempR < 1.0E6 && tempR >= 1.0E3){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-3,2)+" \u00d7 10","3","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E-3,2)+"x 10 3");
		    }
		    else if(tempR < 1.0E9 && tempR >= 1.0E6){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-6,2)+" \u00d7 10","6","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E-6,2)+"x 10 6");
		    }
		    else if(tempR < 1.0E12 && tempR >= 1.0E9){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-9,2)+" \u00d7 10","9","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E-9,2)+"x 10 9");
		    }
		    else if(tempR < 1.0E15 && tempR >= 1.0E12){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-12,2)+" \u00d7 10","12","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E-12,2)+"x 10 12");
		    }
		    else if(tempR < 1.0E18 && tempR >= 1.0E15){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-15,2)+" \u00d7 10","15","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E-15,2)+"x 10 15");
		    }
		    else if(tempR < 1.0E21 && tempR >= 1.0E18){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-18,2)+" \u00d7 10","18","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E-18,2)+"x 10 18");
		    }
		    else if(tempR < 1.0E24 && tempR >= 1.0E21){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-21,2)+" \u00d7 10","21","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E-21,2)+"x 10 21");
		    }
		    else if(tempR < 1.0E27 && tempR >= 1.0E24){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-24,2)+" \u00d7 10","24","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E-24,2)+"x 10 24");
		    }
		    else if(tempR < 1.0E30 && tempR >= 1.0E27){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-27,2)+" \u00d7 10","27","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E-27,2)+"x 10 27");
		    }
		    else if(tempR >= 1.0E30){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-30,2)+" \u00d7 10","30","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E-30,2)+"x 10 30");
		    }
		    else if(tempR < 1.0E-3 && tempR >= 1.0E-6){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E6,2)+" \u00d7 10","-6","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E6,2)+"x 10 -6");
		    }
		    else if(tempR < 1.0E-6 && tempR >= 1.0E-9){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E9,2)+" \u00d7 10","-9","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E9,2)+"x 10 -9");
		    }
		    else if(tempR < 1.0E-9 && tempR >= 1.0E-12){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E12,2)+" \u00d7 10","-12","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E12,2)+"x 10 -12");
		    }
		    else if(tempR < 1.0E-12 && tempR >= 1.0E-15){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E15,2)+" \u00d7 10","-15","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E15,2)+"x 10 -15");
		    }
		    else if(tempR < 1.0E-15 && tempR >= 1.0E-18){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E18,2)+" \u00d7 10","-18","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E18,2)+"x 10 -18");
		    }
		    else if(tempR < 1.0E-18 && tempR >= 1.0E-21){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E21,2)+" \u00d7 10","-21","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E21,2)+"x 10 -21");
		    }
		    else if(tempR < 1.0E-21 && tempR >= 1.0E-24){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E24,2)+" \u00d7 10","-24","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E24,2)+"x 10 -24");
		    }
                    else if(tempR < 1.0E-24 && tempR >= 1.0E-27){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E27,2)+" \u00d7 10","-27","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E27,2)+"x 10 -27");
		    }
                    else if(tempR < 1.0E-27 && tempR >= 1.0E-30){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E30,2)+" \u00d7 10","-30","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= "+MaestroA.rounder(tempR*1.0E30,2)+"x 10 -30");
		    }
                    else if(tempR < 1.0E-30 && tempR != 0.0){
			MaestroG.superscripter("= 0.0","","",g,fontonew,xinit2,y);
			stepx = fm.stringWidth("= 0.0");
		    }
		    
		    tempX = Math.abs(state.SurfaceImpedance.Imaginary());
		    xinit3 = xinit2+stepx;
		    
		    if(tempX < 1.0E3 && tempX >= 1.0E-3){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX,6),"",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX == 0.0){
			MaestroG.superscripter(" - j 0.0","",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E6 && tempX >= 1.0E3){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-3,2)+" \u00d7 10","3",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E9 && tempX >= 1.0E6){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-6,2)+" \u00d7 10","6",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E12 && tempX >= 1.0E9){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-9,2)+" \u00d7 10","9",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E15 && tempX >= 1.0E12){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-12,2)+" \u00d7 10","12",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E18 && tempX >= 1.0E15){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-15,2)+" \u00d7 10","15",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E21 && tempX >= 1.0E18){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-18,2)+" \u00d7 10","18",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E24 && tempX >= 1.0E21){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-21,2)+" \u00d7 10","21",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E27 && tempX >= 1.0E24){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-24,2)+" \u00d7 10","24",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E30 && tempX >= 1.0E27){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-27,2)+" \u00d7 10","27",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX >= 1.0E30){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E-30,2)+" \u00d7 10","30",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E-3 && tempX >= 1.0E-6){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E6,2)+" \u00d7 10","-6",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E-6 && tempX >= 1.0E-9){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E9,2)+" \u00d7 10","-9",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E-9 && tempX >= 1.0E-12){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E12,2)+" \u00d7 10","-12",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E-12 && tempX >= 1.0E-15){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E15,2)+" \u00d7 10","-15",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E-15 && tempX >= 1.0E-18){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E18,2)+" \u00d7 10","-18",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E-18 && tempX >= 1.0E-21){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E21,2)+" \u00d7 10","-21",""+zunit,g,fontonew,xinit3,y);
		    }
		    else if(tempX < 1.0E-21 && tempX >= 1.0E-24){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E24,2)+" \u00d7 10","-24",""+zunit,g,fontonew,xinit3,y);
		    }
                    else if(tempX < 1.0E-24 && tempX >= 1.0E-27){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E27,2)+" \u00d7 10","-27",""+zunit,g,fontonew,xinit3,y);
		    }
                    else if(tempX < 1.0E-27 && tempX >= 1.0E-30){
			MaestroG.superscripter(sign+""+MaestroA.rounder(tempX*1.0E30,2)+" \u00d7 10","-30",""+zunit,g,fontonew,xinit3,y);
		    }
                    else if(tempX < 1.0E-30 && tempX != 0.0){
			MaestroG.superscripter(sign+" 0.0","",""+zunit,g,fontonew,xinit3,y);
		    }
                }
                
                y = y+dyy;
                
                g.setColor(Color.red.darker());
                MaestroG.subscripter("Capacitance","","",g,13,x,y);
                
                zunit = "[ F ]";
                y +=dy;
                
                g.setColor(Color.black); 
            	MaestroG.subscripter("C","","",g,fontonew,x+dxx,y);
                fm = g.getFontMetrics();
                xinit2 = x+dxx+fm.stringWidth("ZS ");
                
                if(state.Capacitance == 0.0){
		    MaestroG.subscripterInfinityOne("= ","","","  "+zunit,g,fontonew,xinit2,y);              
      		}
		else{
                
                    tempR=0.0; tempX=0.0;
                    stepx = 0;
                    sign = plusj;
                    
                    tempR = state.Capacitance;
		    
		    
		    if(tempR < 1.0E3 && tempR >= 1.0E-3){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR,6),""," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR == 0.0){
			MaestroG.superscripter("= 0.0",""," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E6 && tempR >= 1.0E3){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-3,2)+" \u00d7 10","3"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E9 && tempR >= 1.0E6){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-6,2)+" \u00d7 10","6"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E12 && tempR >= 1.0E9){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-9,2)+" \u00d7 10","9"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E15 && tempR >= 1.0E12){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-12,2)+" \u00d7 10","12"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E18 && tempR >= 1.0E15){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-15,2)+" \u00d7 10","15"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E21 && tempR >= 1.0E18){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-18,2)+" \u00d7 10","18"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E24 && tempR >= 1.0E21){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-21,2)+" \u00d7 10","21"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E27 && tempR >= 1.0E24){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-24,2)+" \u00d7 10","24"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E30 && tempR >= 1.0E27){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-27,2)+" \u00d7 10","27"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR >= 1.0E30){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-30,2)+" \u00d7 10","30"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-3 && tempR >= 1.0E-6){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E6,2)+" \u00d7 10","-6"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-6 && tempR >= 1.0E-9){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E9,2)+" \u00d7 10","-9"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-9 && tempR >= 1.0E-12){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E12,2)+" \u00d7 10","-12"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-12 && tempR >= 1.0E-15){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E15,2)+" \u00d7 10","-15"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-15 && tempR >= 1.0E-18){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E18,2)+" \u00d7 10","-18"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-18 && tempR >= 1.0E-21){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E21,2)+" \u00d7 10","-21"," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-21 && tempR >= 1.0E-24){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E24,2)+" \u00d7 10","-24"," "+zunit,g,fontonew,xinit2,y);
		    }
                    else if(tempR < 1.0E-24 && tempR >= 1.0E-27){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E27,2)+" \u00d7 10","-27"," "+zunit,g,fontonew,xinit2,y);
		    }
                    else if(tempR < 1.0E-27 && tempR >= 1.0E-30){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E30,2)+" \u00d7 10","-30"," "+zunit,g,fontonew,xinit2,y);
		    }
                    else if(tempR < 1.0E-30 && tempR != 0.0){
			MaestroG.superscripter("= 0.0",""," "+zunit,g,fontonew,xinit2,y);
		    }
                }
                
                //==============================================================
                
                y = y+dyy;
                
                g.setColor(Color.blue.darker());
                MaestroG.subscripter("Surface charge density on plates","","",g,13,x,y);
                
                zunit = "[ C / m\u00b2 ]";
                y +=dy;
                
                g.setColor(Color.black); 
            	MaestroG.subscripter("Q","S","",g,fontonew,x+dxx,y);
                fm = g.getFontMetrics();
                xinit2 = x+dxx+fm.stringWidth("ZS ");
                
                if(state.Capacitance == 0.0){
		    MaestroG.subscripterInfinityOne("= ","","","  "+zunit,g,fontonew,xinit2,y);              
      		}
		else{
                
                    tempR=0.0; tempX=0.0;
                    stepx = 0;
                    sign = plusj;
                    
                    tempR = state.Charge_density;
		    
		    
		    if(tempR < 1.0E3 && tempR >= 1.0E-3){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR,6),""," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR == 0.0){
			MaestroG.superscripter("= 0.0",""," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E6 && tempR >= 1.0E3){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-3,2)+" \u00d7 10","3"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E9 && tempR >= 1.0E6){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-6,2)+" \u00d7 10","6"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E12 && tempR >= 1.0E9){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-9,2)+" \u00d7 10","9"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E15 && tempR >= 1.0E12){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-12,2)+" \u00d7 10","12"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E18 && tempR >= 1.0E15){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-15,2)+" \u00d7 10","15"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E21 && tempR >= 1.0E18){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-18,2)+" \u00d7 10","18"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E24 && tempR >= 1.0E21){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-21,2)+" \u00d7 10","21"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E27 && tempR >= 1.0E24){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-24,2)+" \u00d7 10","24"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E30 && tempR >= 1.0E27){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-27,2)+" \u00d7 10","27"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR >= 1.0E30){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E-30,2)+" \u00d7 10","30"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-3 && tempR >= 1.0E-6){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E6,2)+" \u00d7 10","-6"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-6 && tempR >= 1.0E-9){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E9,2)+" \u00d7 10","-9"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-9 && tempR >= 1.0E-12){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E12,2)+" \u00d7 10","-12"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-12 && tempR >= 1.0E-15){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E15,2)+" \u00d7 10","-15"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-15 && tempR >= 1.0E-18){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E18,2)+" \u00d7 10","-18"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-18 && tempR >= 1.0E-21){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E21,2)+" \u00d7 10","-21"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-21 && tempR >= 1.0E-24){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E24,2)+" \u00d7 10","-24"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
                    else if(tempR < 1.0E-24 && tempR >= 1.0E-27){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E27,2)+" \u00d7 10","-27"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
                    else if(tempR < 1.0E-27 && tempR >= 1.0E-30){
			MaestroG.superscripter("= "+MaestroA.rounder(tempR*1.0E30,2)+" \u00d7 10","-30"," cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
                    else if(tempR < 1.0E-30 && tempR != 0.0){
			MaestroG.superscripter("= 0.0",""," "+zunit,g,fontonew,xinit2,y);
		    }
                }
                //==============================================================
                
                y +=dyy;
                g.setColor(Color.red.darker());
                MaestroG.subscripter("Voltage","","",g,13,x,y);
                
                y = y+dy;
                g.setColor(Color.black); 
            	MaestroG.subscripterWavy("V","S","( t )",g,fontonew,x+dxx,y);
                fm = g.getFontMetrics();
                xinit2 = x+dxx+fm.stringWidth("VS( t ) ");
                zunit ="[ V ]";
                double dtmp2 = 0.0;
                //printdata(Complex.Magnitude(state.total_voltage), g, fontonew, xinit2, y, zunit);
                tempR = state.Ex;
                        
                    if(tempR == 0.0){dtmp2 = 0.0;}
                    else{dtmp2=MaestroA.rounder(state.total_voltage.Arg2(),4);}
                
                    		    
		    if(tempR < 1.0E3 && tempR >= 1.0E-3){
                        MaestroG.SansMiditalic("= "+MaestroA.rounder(tempR,6)," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR == 0.0){
			MaestroG.SansMiditalic("= 0.0"," "," "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E6 && tempR >= 1.0E3){
                        MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E-3,2)+" \u00d7 10","3"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E9 && tempR >= 1.0E6){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E-6,2)+" \u00d7 10","6"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E12 && tempR >= 1.0E9){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E-9,2)+" \u00d7 10","9"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E15 && tempR >= 1.0E12){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E-12,2)+" \u00d7 10","12"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E18 && tempR >= 1.0E15){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E-15,2)+" \u00d7 10","15"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E21 && tempR >= 1.0E18){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E-18,2)+" \u00d7 10","18"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E24 && tempR >= 1.0E21){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E-21,2)+" \u00d7 10","21"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E27 && tempR >= 1.0E24){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E-24,2)+" \u00d7 10","24"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E30 && tempR >= 1.0E27){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E-27,2)+" \u00d7 10","27"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR >= 1.0E30){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E-30,2)+" \u00d7 10","30"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-3 && tempR >= 1.0E-6){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E6,2)+" \u00d7 10","-6"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-6 && tempR >= 1.0E-9){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E9,2)+" \u00d7 10","-9"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-9 && tempR >= 1.0E-12){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E12,2)+" \u00d7 10","-12"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-12 && tempR >= 1.0E-15){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E15,2)+" \u00d7 10","-15"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-15 && tempR >= 1.0E-18){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E18,2)+" \u00d7 10","-18"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-18 && tempR >= 1.0E-21){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E21,2)+" \u00d7 10","-21"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-21 && tempR >= 1.0E-24){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E24,2)+" \u00d7 10","-24"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
                    else if(tempR < 1.0E-24 && tempR >= 1.0E-27){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E27,2)+" \u00d7 10","-27"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
                    else if(tempR < 1.0E-27 && tempR >= 1.0E-30){
			MaestroG.SansMiditalicSuper("= "+MaestroA.rounder(tempR*1.0E30,2)+" \u00d7 10","-30"," ","cos(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
                    else if(tempR < 1.0E-30 && tempR != 0.0){
			MaestroG.SansMiditalic("= 0.0"," ",""+zunit,g,fontonew,xinit2,y);
		    }
                    
                //==============================================================
                
                y +=dyy;
                g.setColor(Color.blue.darker());
                MaestroG.subscripter("Displacement Current","","",g,13,x,y);
                y = y+dy;
                
                g.setColor(Color.black); 
            	MaestroG.subscripterWavy(" I","2d","( t )",g,fontonew,x+dxx-5,y);
                fm = g.getFontMetrics();
                xinit2 = x+dxx+fm.stringWidth(" I2d ( t )");
                zunit ="[ A ]";
                //printdata(Complex.Magnitude(state.total_current), g, fontonew, xinit2, y, zunit);
                
                double Tolerance;
                Tolerance = 1.0E-10;
                String plusr, minusr, signr;
		plusj =" + j ";
		minusj=" - j ";
                plusr ="";
                minusr =" - ";
	    
                tempR=0.0; tempX=0.0;
                stepx = 0;
                
                    dtmp2 = 0.0;
		    tempR = Math.abs(state.displacement_current);
                    
                    		    
		    if(tempR < 1.0E3 && tempR >= 1.0E-3){
                        MaestroG.SansMiditalic("= - "+MaestroA.rounder(tempR,6)," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR == 0.0){
			MaestroG.SansMiditalic("= 0.0","  ",""+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E6 && tempR >= 1.0E3){
                        MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E-3,2)+" \u00d7 10","3"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E9 && tempR >= 1.0E6){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E-6,2)+" \u00d7 10","6"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E12 && tempR >= 1.0E9){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E-9,2)+" \u00d7 10","9"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E15 && tempR >= 1.0E12){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E-12,2)+" \u00d7 10","12"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E18 && tempR >= 1.0E15){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E-15,2)+" \u00d7 10","15"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E21 && tempR >= 1.0E18){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E-18,2)+" \u00d7 10","18"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E24 && tempR >= 1.0E21){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E-21,2)+" \u00d7 10","21"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E27 && tempR >= 1.0E24){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E-24,2)+" \u00d7 10","24"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E30 && tempR >= 1.0E27){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E-27,2)+" \u00d7 10","27"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR >= 1.0E30){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E-30,2)+" \u00d7 10","30"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-3 && tempR >= 1.0E-6){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E6,2)+" \u00d7 10","-6"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-6 && tempR >= 1.0E-9){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E9,2)+" \u00d7 10","-9"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-9 && tempR >= 1.0E-12){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E12,2)+" \u00d7 10","-12"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-12 && tempR >= 1.0E-15){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E15,2)+" \u00d7 10","-15"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-15 && tempR >= 1.0E-18){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E18,2)+" \u00d7 10","-18"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-18 && tempR >= 1.0E-21){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E21,2)+" \u00d7 10","-21"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
		    else if(tempR < 1.0E-21 && tempR >= 1.0E-24){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E24,2)+" \u00d7 10","-24"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
                    else if(tempR < 1.0E-24 && tempR >= 1.0E-27){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E27,2)+" \u00d7 10","-27"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
                    else if(tempR < 1.0E-27 && tempR >= 1.0E-30){
			MaestroG.SansMiditalicSuper("= - "+MaestroA.rounder(tempR*1.0E30,2)+" \u00d7 10","-30"," ","sin(\u03c9 t) "+zunit,g,fontonew,xinit2,y);
		    }
                    else if(tempR < 1.0E-30 && tempR != 0.0){
			MaestroG.SansMiditalic("= 0.0"," ",""+zunit,g,fontonew,xinit2,y);
		    }
            
            
                
	}
        
        public static void printdata(double power, Graphics g, int fonto, int xinit2, int y, String unita){
            if(power < 1.0e-15 && power != 0.0){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e16,5)+"  \u00d7  10","-16"," "+unita,g,fonto,xinit2,y);
	    }
            if(power == 0.0){
		MaestroG.superscripter("  =  0.0",""," "+unita,g,fonto,xinit2,y);
	    }
            if(power >= 1.0e-15 && power < 1.0e-14){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e15,5)+"  \u00d7  10","-15"," "+unita,g,fonto,xinit2,y);
	    }
            if(power >= 1.0e-14 && power < 1.0e-13){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e14,5)+"  \u00d7  10","-14"," "+unita,g,fonto,xinit2,y);
	    }
            if(power >= 1.0e-13 && power < 1.0e-12){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e13,5)+"  \u00d7  10","-13"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-12 && power < 1.0e-11){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e12,5)+"  \u00d7  10","-12"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-11 && power < 1.0e-10){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e11,5)+"  \u00d7  10","-11"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-10 && power < 1.0e-9){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e10,5)+"  \u00d7  10","-10"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-9 && power < 1.0e-8){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e9,5)+"  \u00d7  10","-9"," "+unita,g,fonto,xinit2,y);
	    }
	    
	    if(power >= 1.0e-8 && power < 1.0e-7){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e8,5)+"  \u00d7  10","-8"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-7 && power < 1.0e-6){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e7,5)+"  \u00d7  10","-7"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-6 && power < 1.0e-5){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e6,5)+"  \u00d7  10","-6"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-5 && power < 1.0e-4){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e5,5)+"  \u00d7  10","-5"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-4 && power < 1.0e-3){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e4,5)+"  \u00d7  10","-4"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-3 && power < 1.0e-2){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e3,5)+"  \u00d7  10","-3"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-2 && power < 1.0e-1){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e2,5)+"  \u00d7  10","-2"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e-1 && power < 1.0){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e1,5)+"  \u00d7  10","-1"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0 && power < 1.0e1){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power,5)+"  ",""," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e1 && power < 1.0e2){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power,5)+"  ",""," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e2 && power < 1.0e3){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-2,5)+"  \u00d7  10","2"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e3 && power < 1.0e4){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-3,5)+"  \u00d7  10","3"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e4 && power < 1.0e5){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-4,5)+"  \u00d7  10","4"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e5 && power < 1.0e6){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-5,5)+"  \u00d7  10","5"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e6 && power < 1.0e7){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-6,5)+"  \u00d7  10","6"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e7 && power < 1.0e8){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-7,5)+"  \u00d7  10","7"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e8 && power < 1.0e9){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-8,5)+"  \u00d7  10","8"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e9 && power < 1.0e10){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-9,5)+"  \u00d7  10","9"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e10 && power < 1.0e11){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-10,5)+"  \u00d7  10","10"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e11 && power < 1.0e12){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-11,5)+"  \u00d7  10","11"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e12 && power < 1.0e13){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-12,5)+"  \u00d7  10","12"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e13 && power < 1.0e14){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-13,5)+"  \u00d7  10","13"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e14 && power < 1.0e15){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-14,5)+"  \u00d7  10","14"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e15 && power < 1.0e16){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-15,5)+"  \u00d7  10","15"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e16 && power < 1.0e17){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-16,5)+"  \u00d7  10","16"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e17 && power < 1.0e18){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-17,5)+"  \u00d7  10","17"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e18 && power < 1.0e19){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-18,5)+"  \u00d7  10","18"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e19 && power < 1.0e20){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-19,5)+"  \u00d7  10","19"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e20 && power < 1.0e21){
		MaestroG.superscripter("  =  "+MaestroA.rounder(power*1.0e-20,5)+"  \u00d7  10","20"," "+unita,g,fonto,xinit2,y);
	    }
	    if(power >= 1.0e21){
		MaestroG.superscripter("  =  "+power+"",""," "+unita,g,fonto,xinit2,y);
	    }
        }
}

