How to plot Sin wave ?

T

Thomas Matthews

Sloan said:
I want to use MFC to plot Sin Wave . How can I do ?

The _standard_ C++ method to plot a sine wave is to
use ASCII artwork.

For example, use '*' as the point character.
I would create a vector of strings. Each string
represents the points in the horizontal direction.
The vector represents the vertical direction.

Hey, it may not be spectacular but it is portable
and doesn't depend on platform specifics of
untrustworthy mega-businesses.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
U

Uwe Schnitker

Thomas Matthews said:
The _standard_ C++ method to plot a sine wave is to
use ASCII artwork.

The pragmatic - as in PragProg - method to plot a sine wave with C++ is to
write ASCII output that can be understood by a plotting program, e.g. gnuplot,
or to write a SVG file that can be displayed by a sufficiently capable web
browser.

Hey, it may not be spectacular but it is portable
and doesn't depend on platform specifics of
untrustworthy mega-businesses.

Such output can be made to look really nice, and you don't need any complicated
framework, whether from untrustworthy mega-businesses or other, more convenient,
sources.

Uwe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top