Converting Equations To Graphics

B

Brian

Hi, I have a question about converting mathematical equations to
graphics in the C programming language:

Let's say I want an image of a dragon, and I want to use mathematical
equations to represent this image. How would I convert the equations
to the image of the dragon in the C language?

Brian
 
J

JohnF

Brian said:
Hi, I have a question about converting mathematical equations to
graphics in the C programming language:
Let's say I want an image of a dragon, and I want to use mathematical
equations to represent this image. How would I convert the equations
to the image of the dragon in the C language?
Brian

That's hardly a C question, per se. However, dragons aside, you can
convert equations to images, entirely in C, with my program
http://www.forkosh.com/gifsave89.html#gifgraph
where gifgraph is just a small front-end C utility to my
gifsave89 C library (which is a rewrite of Sverre Huseby's
original gifsave).
 
J

James Kuyper

Hi, I have a question about converting mathematical equations to
graphics in the C programming language:

Let's say I want an image of a dragon, and I want to use mathematical
equations to represent this image. How would I convert the equations
to the image of the dragon in the C language?

The C language has no built-in ability to do graphics. However, there's
many graphics libraries to choose from that have a C interface. The hard
part is choosing the right one. You need to identify the specific kinds
of platforms you want to display your dragon on, and then someone will
probably be able to tell you the best one to use. I won't be able to
tell you; most of the graphics I produce are scientific data plots,
which generally require quite different capabilities than the kind of
image you're talking about.

However, that's relatively trivial. I think the really hard part of that
process is the one you skipped over: choosing equations to represent the
image. The most straight-forward way to display an image involves
retrieving the brightness of each pixel from a file (possibly in a
compressed format), and then writing that image data to the screen. Any
method that uses equations as an intermediate step in the process is
going to be conceptually much more complicated, unless you're talking
about only a small number of simple equations.

Did you mean "_a_ dragon" rather than "_the_ dragon" ? There might not
any real dragons in this world (though Komodo Dragons come close enough
for many purposes), but there's certainly a huge number of fictional
dragons to choose from. If you have a single particular one you want to
draw, you'll need to identify it more precisely than that.
 
B

Brian

C has no standard method for outputting graphics. This means you will
need to use some graphical library outside of the C language standard.

This, at least to the standard, you are going to need to use something
"implementation dependent" library to do this. There are probably some
libraries designed to be fairly portable available. There does need to
be a bit more definition here as to what you want. Do you mean drawing
the image as part of a screen display as part of a programs graphical
interface? (and if so, what library are you using to generate the
graphical interface?), do you mean generating a standard image file
(like a bit map, jpeg, png or some other standard image file format)? or
possibly something else?

Thank you everybody for your input. I found an online equation
editor, and I was able to accomplish my goal with it.
 
Ö

Öö Tiib

Hi, I have a question about converting mathematical equations to
graphics in the C programming language:

Let's say I want an image of a dragon, and I want to use mathematical
equations to represent this image. How would I convert the equations
to the image of the dragon in the C language?

Very simple. You start first by choosing if you want it to be
two-dimensional or three-dimensional image of dragon. Then you decide if
you want it to be animated or standing still. Based on previous decisions
you choose graphics engine or library and then write C code that
produces the image using that engine or library from mathematical equation.
 
J

James Kuyper

Hi, I have a question about converting mathematical equations to
graphics in the C programming language:

Let's say I want an image of a dragon, and I want to use mathematical
equations to represent this image.
[snip]

Did you mean "_a_ dragon" rather than "_the_ dragon" ?
[snip]

The OP /may/ have meant "a dragon curve", which can be expressed as a set of
equations.

http://en.wikipedia.org/wiki/Dragon_curve

Ahh! That would address two of the three points I brought up. I knew of
the Dragon Curve, it just didn't occur to me that he might be talking
about it.
 

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,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top