Click here to Skip to main content
15,878,852 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
I would like to write a program that will display the graph for sin (x) function where 0 <= x <= 180 in a console application, anybody can help?? plz
Posted
Updated 2-Nov-11 13:51pm
v2
Comments
Richard MacCutchan 2-Nov-11 18:42pm    
You cannot easily draw a graph in a console application, you would be better to create a forms application and draw points and lines on the form.
Sergey Alexandrovich Kryukov 2-Nov-11 19:21pm    
Just tell us: why?
--SA
Yvan Rodrigues 3-Nov-11 15:37pm    
Output to a daisy-wheel printer?
(Damn I just dated myself.)

1 solution

Try gnuplot:

gnuplot> set terminal dumb
Terminal type set to 'dumb'
Options are 'feed 79 24'
gnuplot> plot sin(x)

   1 ++----------------**---------------+----**-----------+--------**-----++
     +                *+ *              +   *  *          +  sin(x) ****** +
 0.8 ++              *    *                *    *                *    *   ++
     |               *    *                *    *                *    *    |
 0.6 ++              *     *              *      *              *      *  ++
     *              *       *             *       *             *      *   |
 0.4 +*             *       *             *       *             *      *  ++
     |*            *        *            *        *            *        *  |
 0.2 +*            *        *            *        *            *        * ++
     | *          *          *          *          *          *          * |
   0 ++*          *          *          *          *          *          *++
     |  *         *           *         *           *         *           *|
-0.2 ++ *         *           *         *           *         *           *+
     |   *       *            *        *            *        *            *|
-0.4 ++  *       *            *        *            *        *            *+
     |   *      *              *      *              *      *              *
-0.6 ++  *      *              *      *              *      *             ++
     |    *     *               *     *               *    *               |
-0.8 ++    *   *                 *   *                *    *              ++
     +     *  *        +         *  *   +              *  *                +
  -1 ++-----**---------+----------**----+---------------**+---------------++
    -10               -5                0                 5                10


or this:

http://wdas.github.com/SeExpr/doxygen/mytut.html[^]

./asciiGraph "val=.5*PI*x;7*sin(val)/val"
                              |                             
                              |                             
                             ###                            
                            # |#                            
                           ## |##                           
                           #  | #                           
                          ##  | ##                          
                          #   |  #                          
                         ##   |  ##                         
                         #    |   #                         
                         #    |   ##                        
             ####       #     |    #       ####             
#######-----##--###-----#-----|----##-----##--###-----######
      ######      ##   #      |     #    #      ######      
                   ## ##      |     ## ##                   
                    ###       |      ###                    
                              |                             
                              |                             
                              |   


I know you said VB. Net, but we can't spoon-feed you :)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900