
function sq(x){return x*x}

function zcal(){fh=document.forms[0];rr1=fh.z1r.value;xx1=fh.z1x.value;rr2=fh.z2r.value;xx2=fh.z2x.value;rr=fh.zer.value=rr1-(-1)*rr2;xx=fh.zex.value=xx1-(-1)*xx2;zz=fh.zea.value=Math.sqrt(sq(rr)-(-1)*sq(xx));fh.zep.value=Math.atan(xx/rr)*180/Math.PI;t1=(rr1*rr2-xx1*xx2)*(rr1-(-1)*rr2);t2=(xx1*rr2-(-1)*xx2*rr1)*(xx1-(-1)*xx2);t3=sq(rr1-(-1)*rr2)-(-1)*sq(xx1-(-1)*xx2);rrp=(t1-(-1)*t2)/t3;fh.zerp.value=rrp;t4=(xx1*rr2-(-1)*xx2*rr1)*(rr1-(-1)*rr2);t5=(rr1*rr2-xx1*xx2)*(xx1-(-1)*xx2);t6=sq(rr1-(-1)*rr2)-(-1)*sq(xx1-(-1)*xx2);xxp=(t4-t5)/t6;fh.zexp.value=xxp;fh.zeap.value=Math.sqrt(sq(rrp)-(-1)*sq(xxp));fh.zepp.value=Math.atan(xxp/rrp)*180/Math.PI}





