timing
Hi,
Yes - unfortunately due to the fact that you cant plot a single point with the .NET libary I have to draw it with connecting lines.
(form.line(0,0,1,0,cblack) wont draw just one pixel long - this is a flaw in .NET library - smallest lines being 0 points long or 2 pixels long!)
Its not slow on my device but if you want to speed it up you can double the step line to
s=2/r
because you dont really need the steps to be as small as 1/r
I looked at your code and it looks good, no major problems.
I wouldnt have done it writing to a bitmap because it seems an extra step, but given there is the .NET line bug (that you cant plot a single point) it means there is one advantage of doing it ur way
Just as a minor critique, on circle you use lable name txtr but this is actually the diameter not the radius so txtdiam would be better name! Thats why u divide it by two when calculating the radius.
In future I would tighten up the variable naming - as I said before use x,y,x1,y1 etc for co-ordinates but try and use something like l,length,ylen etc etc for lengths. Theres a few places where one minute x,y is a co-ordinate then the next its lengths lol! e.g
y2 = (y2 / 2) + Min(txty2.Text,txty1.Text)
ylen might be a clearer variable name here! Other than that its a good start!
Last edited by colin9876 : 05-24-2008 at 12:04 PM.
|