gwycon.com
Silverlight, WPF and C# .NET development
User NamePassword

15
Jan

Here is an implementation of a trigonometric function, plotted as a 2D graph. Interactive controls are available to alter the graph dynamically. The sine wave plotted incorporates parameters commonly used in physics. You can directly control the amplitude (A), phase (phi), and the angular frequency (k).

Try it now! Click on the slider bars in the Flash example above to change the sine waves properties.

There are also some basic graph options that can be set via check boxes, these can be toggled on/off. Finally, there is a useful function that is a good thing to have in any application, and that is a reset button. This simply resets the graph back to the state when first loaded. This example is coded using ActionScript 2.0.

Extending this example to graph any function is fairly straight forward and could handle some quite complex equations with multiple parameters. The range of each axis would have to be carefully rendered though to make sure the graph ‘zoom’ was correctly set, otherwise the graph may not display correctly.

Category : ActionScript / Flash / Mathematics

4 Responses to “Interactive Sine Wave”


Donald May January 22, 2009

As an 8th grade Physical Science teacher I needed something to show my students about changing frequency and wavelength. Your interactive graphic fit the bill. Thanks
Donald L May
East Paulding Middle School
Dallas GA 30157

David January 26, 2009

Thanks Donald, it is nice to know you found our interactive sine graph useful. This example is typical of the sort of application we create for our clients. Any feedback from yourself or some of your students would be welcome, as would any suggestions for future applications.

Also, we plan to release a much more comprehensive version of this particular example sometime in the future, so watch this space!

Steven April 10, 2009

Why does your graph start going towards the negative direction of the y-axis?. When you reset it, the dilation factor is “positive one” from the x-axis, however when your graph resets, the “Amplitude” value is 1, but yet your graph turns out to be a negative sin graph (relection in the x-axis)

David April 10, 2009

Dilation factor?

It’s a Sine wave, what more can I tell you! Amplitude is reversed yes, just needs updating. ;-)