double amplitude = 1.7;
double period = 2;
PointPairList ppl = new PointPairList();
double y=0;
for (double x = 0; x <= 10; x += .005)
{
double p = (x % (period)) / period ;
if (p >= 0 && p <= 0.25)
y = 4 * p * amplitude;
if (p > 0.25 && p < 0.5)
y = amplitude - (p - 0.25) * 4 * amplitude;
if(p>0.5 && p<=0.75)
y = - 4 * (p-0.5) * amplitude;
if(p>0.75 && p<=1)
y = - (amplitude - (p - 0.75) * 4 * amplitude);
ppl.Add(x,y);
}
var line = zg1.MasterPane[0].AddCurve("", ppl, Color.Blue);
line.Symbol.IsVisible = false;
zg1.AxisChange();
zg1.Refresh();
Gacek
2009-11-02 16:36:33