Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

plotting/graphing in a DOS console

Status
Not open for further replies.

Sedai

Programmer
Mar 4, 2001
158
US
Hi!

I need to be able to draw points, given X and Y coords, then connect them, and then 'fill up' an area defined by three or more lines.
I have the algorith for connecting 3 and 4 points and calculating the area of the figure, given my rules.
How can I show this graphically?
any special .h file with predefined functions...?

(im talking about a DOS console application)
thanks Avendeval


 


well my friend u need to include <graphics.h>

u need to initialise the graphics driver first and then try to use basic funcions like line , circle , etc. then u have to consider ur code to be doing that .

UR problem is not that difficult . As far as connecing lines is concerned there is absolutely no problem just go on drawing line from the end points of each lin like

line (x1,y1,x2,y2)
line (x2,y2,x3,y3)
line (x3,y3,x1,y1)

then u get a triangle

further a good news for u is that we have fill poly functions in C which will fill ne bounding area. look this shoudl help u but if u need some code then u must first reply me then i will think whether u r serious in knowing the solution ..

if i get ur reply i will mail u the program
 
Hi!

Thanks, that's ALL I needed, I know how to do the rest (I don't actually need to fill in the regions, becaue trinagles better demonstrate how the algorithm works). THANKS!!
Avendeval


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top