<script type="text/javascript">
<!--
function q1(n){
Dgr = document.getElementById("q"+n+"1").value;
z = document.getElementById("q"+n+"2").value;
dblRadian = Dgr * (Math.PI/180);
y = z * Math.sin(dblRadian);
x = z * Math.cos(dblRadian);
document.getElementById("a"+n+"1").innerText =y;
document.getElementById("a"+n+"2").innerText =x;
}
function q2(n){
Dgr = document.getElementById("q"+n+"1").value;
x = document.getElementById("q"+n+"2").value;
dblRadian = Dgr * (Math.PI/180);
z = x / Math.cos(dblRadian);
y = x * Math.tan(dblRadian);
document.getElementById("a"+n+"1").innerText =z;
document.getElementById("a"+n+"2").innerText =y;
}
function q3(n){
Dgr = document.getElementById("q"+n+"1").value;
y = document.getElementById("q"+n+"2").value;
dblRadian = Dgr * (Math.PI/180);
z = y / Math.sin(dblRadian);
x = y / Math.tan(dblRadian);
document.getElementById("a"+n+"1").innerText =z;
document.getElementById("a"+n+"2").innerText =x;
}
// -->
</script>