cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Plot coordinates program
Plot coordinates program
May 14, 2016 at 10:58am UTC
MultiMedia
(84)
Hey guys, I have written a program that converts from Cartesian to Polar coordinates and vice versa. Now I am told to draw a very simple graph (a vertical and a horizontal line) and plot the points. How can I go about achieving something like this?
Thank you.
May 14, 2016 at 11:52am UTC
Moschops
(7244)
If you're working with a reasonably standard terminal and nothing fancy, the output is going to be something that looks like this:
1
2
3
4
5
6
7
8
| * | * | * | * | * | * | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You output a bunch of lines, each line starting with | for the vertical axis, and a * on it somewhere for any plot points with that y-value.
Last edited on
May 14, 2016 at 11:52am UTC
May 14, 2016 at 12:04pm UTC
MultiMedia
(84)
Can I use some kind of a function or an external library which handles the plotting for me?
May 14, 2016 at 12:17pm UTC
Moschops
(7244)
Yes. There are many external libraries available for C and C++.
Topic archived. No new replies allowed.