Ive been learning javascript and i cant get it to draw a half circle.
here is the code i came up with

Divisions in jscript
<script language = "javascript">
var mx; //users x value
var my; //users y value
var mr; //users radius
var sy; //solve for y
var i; //for loops
var a; //misc. var
var b; //misc. var
var c; //misc. var
var d; //misc. var
sy = 1;
mx = 100;
my = 100;
mr = 30;
//draw a half circle using the equation y = sqrt(r^2-(x-j)^2-k^2); where (j, k) is the center of the circle
for (i = 100; i < 131; i = i + 1)
a = Math.pow(mr, 2);
b = i - mx;
c = Math.pow(b, 2);
sy = a - c;
sy = Math.floor(Math.sqrt(sy) + my);
document.write("<div id = m["+i+"] STYLE = 'POSITION: ABSOLUTE; TOP: "+sy+"; LEFT: "+i+";'><img src = 'reddot.jpg'></DIV>");
// document.write("a is "+a+"... b is "+b+"... c is "+c+"... d is "+d+"... sy is "+sy+"<BR>"); //this line may be used to see the value of each variable dependant on the loop
does anyone see the problem???