To draw a 2D sine wave in C#, you can use the chart control provided by Windows Forms. Here's a code snippet that demonstrates how to do it:
main.cs651 chars27 lines
This code creates a new chart control, adds a chart area and a series to it, and generates the data for the series by computing the sine of x values between 0 and 2π in steps of 0.1. Finally, the chart is displayed on the form. The resulting chart should show a smooth sine wave in blue.
gistlibby LogSnag