{*
1.一次生成10k个数据进行统计,速度相当快(celeron 1.1g +256m ddr266)<1秒 【程序编程相关:用Delphi实现动态代理(2):设计说】
采用randg(0,1)来生成标准正态分布数据 【推荐阅读:Delphi中用状态图对字符串数据进行类】
3.算法:映射到1..1000个数据点,大于等于+8的,正向封顶,设其为1000;小于等于 -8 的,负向封底,设其为1;如上面所说,为了使曲线看起来更加陡峭,可以在这里改为16封顶.其实,我最初是用+2-2来封及+4-4来封定封底的,效果已经不错了. 【扩展信息:快速导出数据到Excel(一):利用剪贴】
2.绘出的曲线因为选择范围是8,故看起来并不是十分陡峭,可以将其改为16,那么就更加陡峭了
}
unit unit1;
interface
uses
windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, extctrls, stdctrls, math;type
tfrmmain = class(tform)
imgaxis: timage; btnrandg: tbutton; groupbox1: tgroupbox; splitter1: tsplitter; grpcontrol: tgroupbox; chklogfrequency: tcheckbox; chkdrawedge: tcheckbox; chkdrawlines: tcheckbox; cboxcopymode: tcombobox; procedure formshow(sender: tobject); procedure btnrandgclick(sender: tobject); procedure formcreate(sender: tobject); private { private declarations } totalcount :integer; sampledatas :array[1..1000] of integer; procedure drawaxis; procedure gaussit(const asampledata:extended); procedure redraw; procedure drawedge;//画边procedure log(const logname:string);
public { public declarations } end;var
frmmain: tfrmmain;implementation
{$r *.dfm}
procedure tfrmmain.drawaxis; begin imgaxis.canvas.pen.color :=cllime; ... 下一页