Trouble with pythagoras

i have inputs a,b,c.
and im trying to use pythagoras on it…
ive tried two formulas…
both with this annoying result…
it works perfectly teh first tym…
but once i try to enter a different set of values i either get nothing or i get flash deleting the values ive inputted…
is tehre a reason for this?
here are my two formulas


on (release) {
// pythagoras
if (!©){
c = Math.sqrt(Math.pow(a,2) + Math.pow(b,2));
}
if (!(a)){
a = Math.sqrt(Math.pow(c,2) - Math.pow(a,2));
}
if (!(b)){
b = Math.sqrt(Math.pow(c,2) - Math.pow(b,2));
}
}


on(release){
if (Number(a) != 0) {
if (Number(b) != 0) {
c = Math.sqrt((aa)+(bb));
}
if (Number© != 0) {
b = Math.sqrt((cc)-(aa));
}
}
if (Number(b) != 0) {
if (Number(a) != 0) {
c = Math.sqrt((aa)+(bb));
}
if (Number© != 0) {
a = Math.sqrt((cc)-(bb));
}
}
}

Maybe:

on (release) {
	// pythagoras
	var res;
	if (!c){
		res = Math.sqrt(Math.pow(a,2) + Math.pow(b,2));
		c = res;
	}
	if (!a){
		res = Math.sqrt(Math.pow(c,2) - Math.pow(a,2));
		a = res;
	}
	if (!b){
		res = Math.sqrt(Math.pow(c,2) - Math.pow(b,2));
		b = res;
	}
}

Couldn’t test it tough.