TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ghasem deh
NA
258
40.3k
how do draw motion wave with zedgraph
Nov 14 2014 6:21 AM
hi
1 – I want to draw a sine and sawtooth wave…
2 – And use the timer to draw wave motion
3 - how i can clean chart
4 – and combined two-wave (modulation)? I use this code to draw a triangle wave
(textbox = amplitude – frequency – time) :
---------------------------------------------------
GraphPane myPane = zgc.GraphPane;
// Make up some data points from the Sine function
PointPairList list1 = new PointPairList();
double amplitude = double.Parse(textBox2.Text);
double period = double.Parse(textBox3.Text);
double y = 0;
for (double x = 0; x <= double.Parse(textBox1.Text); 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);
list1.Add(x, y);
}
var line = zg1.MasterPane[0].AddCurve("", list1, Color.Goldenrod);
line.Symbol.IsVisible = false;
zg1.AxisChange();
zg1.Refresh();
zgc.AxisChange();
Reply
Answers (
1
)
Project help (fields and overloading methods)
query about string functions in C#