zedgraph画半圆
各位大佬,请教一下,如何在zedgraph里画一个半圆?y=根号(r2-(x-a)2)
我的思路是:
dim x(99) ,y(99) as single '设置100个点
dim i as integer
dim x_start, x_end, r as single' x_start 和 x_end分别为半圆在横坐标上两个交点
dim step as single '设置x增量
dim a as single 'a为圆心在横轴的坐标(a,0)
r = (x_start - x_end)/2
step = (x_end - x_start)/100
for i = 0 to 99:
x(i) += x_start + step
y(i) = math.sqrt(r^2-(x(i)-a)^2)
然后把x和y放到pointpairlist里
next
但是为什么半圆在最后总是缺一截,大家知道原因吗?或者有什么更好的取代方法吗?