Professional Documents
Culture Documents
<head>
<title>Ecuaciones de 2° Grado</title>
</head>
<!--
function ResolverEc()
E1.Resolver(E1);
delete E1;
document.close();
function Ec2gdo(A,B,C)
this.a=A;
this.b=B;
this.c=C;
this.est=0;
this.x1=new Complejo();
this.x2=new Complejo();
this.Resolver=ResolverEc2gdo;
this.ResolverReal=Real;
this.ResolverImaginario=Imaginario;
this.AsString=AsString;
}
function ResolverEc2gdo()
var d=(this.b*this.b)-(4*this.a*this.c);
if(d>=0)
this.ResolverReal(d);
//this.AsString();
}
else
{
this.ResolverImaginario(d);
function Real(D)
var d=D;
var r=Math.sqrt(d);
this.x1.R=((this.b*-1)+r)/(2*this.a);
this.x2.R=((this.b*-1)-r)/(2*this.a);
this.est=0;
this.AsString();
function Imaginario(D)
var d=D;
d*=-1;
this.x1.R=(this.b*-1)/(2*this.a);
this.x1.I=Math.sqrt(d)/(2*this.a);
this.x2.R=this.x1.R;
this.x2.I=this.x1.I;
this.est=1;
this.AsString();
function AsString(res)
//var estado=est;
if(this.est==0)
{
else
'+this.x2.I+' i')
delete x1;
delete x2;
}
function Complejo(R,I)
this.R=(R || 0);
this.I=(I || 0);
//this.Sumar=SumarComplejo;
//this.Restar=RestarComplejo;
//this.Multiplicar=MultiplicarComplejo;
//this.Dividir=DividirComplejo;
-->
</script>
<center><form><font color="#FFFFFF"><b>
onClick="ResolverEc()"><br><br>
<input type="reset"><br><br><br><br><br></form>
</marquee></center><br><br><br>
</body>
</html>