[Android Apps and Games] dovshan:
Electronic Component tools for lecturenotes

Hi

I designed this tools to easily design a circuit.

I am glad if you use this tool.

Npn or pnp transistor

ud= LN.getParameter(1);
x1 = LN.getX1();
y1 = LN.getY1();
x2 = LN.getX2();
y2 = LN.getY2();

if(ud==0){
LN.drawLine(x1 , 0.5*(y1+y2) , x1 + (x2 - x1) * 0.5, 0.5*(y1+y2)* );
LN.drawLine( x1 + (x2 - x1) * 0.5 , y1+(y2-y1) * 0.25 , x1 + (x2 - x1) * 0.5, y1+(y2-y1) * 0.75* );
LN.drawLine( x1 + (x2 - x1) * 0.5 , y1+(y2-y1) * 0.4 , x2,* y1+(y2-y1) * 0.2 );
LN.drawLine( x2 , y1 , x2,* y1+(y2-y1) * 0.2 );
LN.drawLine( x2 , y1+(y2-y1) * 0.8 , x2,* y2 );

x01 = x1 + (x2 - x1) * 0.5 ;
y01 = y1+(y2-y1) * 0.6 ;
x02 = x2;
y02 = y1+(y2-y1) * 0.8 ;
LN.drawLine(x01, y01, x02, y02);

LN.drawFilledTriangle(x02, y02, x1 + (x2 - x1) * 0.9 , y1+(y2-y1) * 0.7 , x1 + (x2 - x1) * 0.8 , y02);

}
if(ud==1){
LN.drawLine(x1 , 0.5*(y1+y2) , x1 + (x2 - x1) * 0.5, 0.5*(y1+y2)* );
LN.drawLine( x1 + (x2 - x1) * 0.5 , y1+(y2-y1) * 0.25 , x1 + (x2 - x1) * 0.5, y1+(y2-y1) * 0.75* );
LN.drawLine( x1 + (x2 - x1) * 0.5 , y1+(y2-y1) * 0.4 , x2,* y1+(y2-y1) * 0.2 );
LN.drawLine( x2 , y1 , x2,* y1+(y2-y1) * 0.2 );
LN.drawLine( x2 , y1+(y2-y1) * 0.8 , x2,* y2 );

x01 = x1 + (x2 - x1) * 0.5 ;
y01 = y1+(y2-y1) * 0.6 ;
x02 = x2;
y02 = y1+(y2-y1) * 0.8 ;
LN.drawLine(x01, y01, x02, y02);
LN.drawFilledTriangle( x1 + (x2 - x1) * 0.5 , y1+(y2-y1) * 0.4 , x1 + (x2 - x1) * 0.65 , y1+(y2-y1) * 0.4 , x1 + (x2 - x1) * 0.6 , y1+(y2-y1) * 0.3);

}

Capacitor

ud = LN.getParameter(1);
x1 = LN.getX1();
y1 = LN.getY1();
x2 = LN.getX2();
y2 = LN.getY2();
x0 = (x1+x2)/2;
y0 = (y1+y2)/2;
if(ud==0){
LN.drawLine(x1,y0, x1 + (x2 - x1) *0.3,y0);
LN.drawLine( x1 + (x2 - x1) *0.3 ,y1, x1 + (x2 - x1) *0.3,y2);
LN.drawLine( x1 + (x2 - x1) *0.7 ,y1, x1 + (x2 - x1) *0.7,y2);
LN.drawLine( x1 + (x2 - x1) *0.7 ,y0, x2,y0);
}
if(ud==1){
LN.drawLine(x0,y1, x0, y1 + (y2 - y1) *0.3 );
LN.drawLine( x1 , y1 + (y2 - y1) *0.3 , x2, y1 + (y2 - y1) *0.3 );
LN.drawLine( x1 , y1 + (y2 - y1) *0.7 , x2, y1 + (y2 - y1) *0.7 );
LN.drawLine(x0, y1 + (y2 - y1) *0.7 , x0,y2 );
}

Inductor

ud= LN.getParameter(1);
x1 = LN.getX1();
y1 = LN.getY1();
x2 = LN.getX2();
y2 = LN.getY2();
x0=(x2+x1)/2;
y0=(y1+y2)/2;
w=(x2-x1)/6;
h=(y2-y1)/6;
if(ud==0){
LN.drawArc(x0,y0,w,h,2.4,4.6);
LN.drawArc(x0+(1.5*w),y0,w,h,2.4,3.88);
LN.drawArc(x0-(1.5*w),y0,w,h,3.15,3.85);
LN.drawLine(x1,y0, x1 + (x2 - x1) *0.08,y0);
LN.drawLine( x1 + (x2 - x1) *0.92 ,y0, x2,y0);
}
if(ud==1){
LN.drawArc(x0,y0,w,h,0.85,4.6);
LN.drawArc(x0,y0-(1.5*h) ,w,h,0.85,3.88);
LN.drawArc(x0,y0+(1.5*h) ,w,h,1.6,3.85);

LN.drawLine(x0,y1, x0, y1 + (y2 - y1) *0.085 );
LN.drawLine(x0, y1 + (y2 - y1) *0.915 , x0,y2);
}

Resistance

ud= LN.getParameter(1);
x1 = LN.getX1();
y1 = LN.getY1();
x2 = LN.getX2();
y2 = LN.getY2();
x0 = (x1+x2)/2;
y0 = (y1+y2)/2;
if(ud==0){
LN.drawLine(x1,y0, x1 + (x2 - x1) *0.125 ,y0);
LN.drawLine( x1 + (x2 - x1) *0.875 ,y0, x2 ,y0);
LN.drawLine( x1 + (x2 - x1) *0.125 ,y0, x1 + (x2 - x1) *0.25 ,y2);
LN.drawLine( x1 + (x2 - x1) *0.25 ,y2, x1 + (x2 - x1) *0.25 ,y1);
LN.drawLine( x1 + (x2 - x1) *0.25 ,y1, x1 + (x2 - x1) *0.5 ,y2);
LN.drawLine( x1 + (x2 - x1) *0.5 ,y2, x1 + (x2 - x1) *0.5 ,y1);
LN.drawLine( x1 + (x2 - x1) *0.5 ,y1, x1 + (x2 - x1) *0.75 ,y2);
LN.drawLine( x1 + (x2 - x1) *0.75 ,y2, x1 + (x2 - x1) *0.75 ,y1);
LN.drawLine( x1 + (x2 - x1) *0.75 ,y1, x1 + (x2 - x1) *0.875 ,y0);
}
if(ud==1){
LN.drawLine(x0,y1, x0, y1 + (y2 - y1) *0.125 );
LN.drawLine( x0 , y1 + (y2 - y1) *0.875 , x0 ,y2);
LN.drawLine( x0 , y1 + (y2 - y1) *0.125 , x1 , y1 + (y2 - y1) *0.25 );
LN.drawLine( x1 , y1 + (y2 - y1) *0.25 , x2 , y1 + (y2 - y1) *0.25 );
LN.drawLine( x2 , y1 + (y2 - y1) *0.25 , x1 , y1 + (y2 - y1) *0.5 );
LN.drawLine( x1 , y1 + (y2 - y1) *0.5 , x2 , y1 + (y2 - y1) *0.5 );
LN.drawLine( x2 , y1 + (y2 - y1) *0.5 , x1 , y1 + (y2 - y1) *0.75 );
LN.drawLine( x1 , y1 + (y2 - y1) *0.75 , x2 , y1 + (y2 - y1) *0.75 );
LN.drawLine( x2 , y1 + (y2 - y1) *0.75 , x0, y1 + (y2 - y1) *0.875 );
}

Diode

ud= LN.getParameter(1);
x1 = LN.getX1();
y1 = LN.getY1();
x2 = LN.getX2();
y2 = LN.getY2();
x0 = (x1+x2)/2;
y0 = (y1+y2)/2;
if(ud==0){
LN.drawLine(x1,y0, x2,y0);
LN.drawLine( x1 + (x2 - x1) *0.7 ,y1, x1 + (x2 - x1) *0.7 ,y2);
LN.drawFilledTriangle( x1 + (x2 - x1) *0.7 , y0, x1 + (x2 - x1) *0.3 , y1, x1 + (x2 - x1) *0.3 , y2);
}
if(ud==1){
LN.drawLine(x0,y1, x0,y2);
LN.drawLine( x1 , y1 + (y2 - y1) *0.7 , x2, y1 + (y2 - y1) *0.7 );
LN.drawFilledTriangle( x0 , y1 + (y2 - y1) *0.7 , x1 , y1 + (y2 - y1) *0.3 , x2 , y1 + (y2 - y1) *0.3 );
}

Source

ud= LN.getParameter(1);
x1 = LN.getX1();
y1 = LN.getY1();
x2 = LN.getX2();
y2 = LN.getY2();
x0 = (x1+x2)/2;
y0 = (y1+y2)/2;
w=(x2-x1)/3;
h=(y2-y1)/3;
if(ud==0){
LN.drawLine(x0,y1, x0,y2);
LN.drawArc(x0,y0,w,h,0,6.5);
LN.drawFilledTriangle( x0, y1 + (y2- y1) *0.83 , x1 + (x2 - x1) *0.45 , y1 + (y2- y1) *0.7 , x1 + (x2 - x1) *0.55 , y1 + (y2- y1) *0.7 );
}
if(ud==1){
LN.drawLine(x0,y1, x0, y1 +(y2- y1) *0.17);
LN.drawLine(x0, y1 + (y2- y1) *0.83 , x0,y2);
LN.drawArc(x0,y0,w,h,0,6.5);
LN.drawLine(x0, y1 +(y2- y1) *0.2 , x0, y1 +(y2- y1) *0.3);
LN.drawLine( x1 +(x2- x1) *0.45 , y1 +(y2- y1) *0.25 , x1 +(x2- x1) *0.55 , y1 +(y2- y1) *0.25);
LN.drawLine( x1 +(x2- x1) *0.45 , y1 +(y2- y1) *0.75 , x1 +(x2- x1) *0.55 , y1 +(y2- y1) *0.75);
}
if(ud==2){
LN.drawLine(x0,y1, x0, y1 +(y2- y1) *0.17);
LN.drawLine(x0, y1 + (y2- y1) *0.83 , x0,y2);
LN.drawArc(x0,y0,w,h,0,6.5);
LN.drawArc( x1 +(x2- x1) *0.39 ,y0,w/3,h/3,3,3.3);
LN.drawArc( x1 +(x2- x1) *0.61 ,y0,w/3,h/3,0,3.3);
}

OP-AMP

x1 = LN.getX1();
y1 = LN.getY1();
x2 = LN.getX2();
y2 = LN.getY2();
x0=(x2+x1)/2;
y0=(y1+y2)/2;
LN.drawLine(x1, y1 + (y2 - y1) *0.125 , x1 + (x2 - x1) *0.125, y1 + (y2 - y1) *0.125 );
LN.drawLine(x1, y1 + (y2 - y1) *0.875 , x1 + (x2 - x1) *0.125, y1 + (y2 - y1) *0.875 );
LN.drawLine( x1 + (x2 - x1) *0.875 ,y0, x2,y0);
LN.drawTriangle( x1 + (x2 - x1) *0.875 , y0, x1 + (x2 - x1) *0.125 , y1 , x1 + (x2 - x1) *0.125 , y2);
LN.drawLine( x1 + (x2 - x1) *0.20 , y1 + (y2 - y1) *0.125 , x1 + (x2 - x1) *0.25, y1 + (y2 - y1) *0.125 );
LN.drawLine( x1 + (x2 - x1) *0.20 , y1 + (y2 - y1) *0.875 , x1 + (x2 - x1) *0.25, y1 + (y2 - y1) *0.875 );
LN.drawLine( x1 + (x2 - x1) *0.225 , y1 + (y2 - y1) *0.850 , x1 + (x2 - x1) *0.225, y1 + (y2 - y1)*0.9 );

GND

ud= LN.getParameter(1);
x1 = LN.getX1();
y1 = LN.getY1();
x2 = LN.getX2();
y2 = LN.getY2();
x0 = (x1+x2)/2;
y0 = (y1+y2)/2;

if(ud==0){
LN.drawLine(x1,y0, x2,y0);
LN.drawLine(x0,y1, x0,y0);
LN.drawLine( x1+(x2-x1)*0.9 ,y0, x1+(x2-x1)*0.7,y2);
LN.drawLine( x1+(x2-x1)*0.7 ,y0, x1+(x2-x1)*0.5,y2);
LN.drawLine( x1+(x2-x1)*0.5 ,y0, x1+(x2-x1)*0.3,y2);
LN.drawLine( x1+(x2-x1)*0.3 ,y0, x1+(x2-x1)*0.1,y2);
LN.drawLine( x1+(x2-x1)*0.1 ,y0, x1-(x2-x1)*0.1,y2);

}
if(ud==1){

LN.drawLine(x1,y0, x2,y0);
LN.drawLine(x0,y1, x0,y0);
LN.drawLine( x1+(x2-x1)*0.125 , y1+(y2-y1)*0.65 , x1+(x2-x1)*0.875, y1+(y2-y1)*0.65 );
LN.drawLine( x1+(x2-x1)*0.25 , y1+(y2-y1)*0.8 , x1+(x2-x1)*0.75, y1+(y2-y1)*0.8 );
LN.drawLine( x1+(x2-x1)*0.375 , y1+(y2-y1)*0.95 , x1+(x2-x1)*0.625, y1+(y2-y1)*0.95 );
}