Converting Equations To Graphics

Discussion in 'C Programming' started by Brian, Mar 24, 2013.

  1. Brian

    Brian Guest

    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
    Brian, Mar 24, 2013
    #1
    1. Advertising

  2. Brian

    JohnF Guest

    Brian <> wrote:
    > 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).
    --
    John Forkosh ( mailto: where j=john and f=forkosh )
    JohnF, Mar 24, 2013
    #2
    1. Advertising

  3. Brian

    James Kuyper Guest

    On 03/24/2013 05:25 PM, Brian wrote:
    > 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.
    --
    James Kuyper
    James Kuyper, Mar 24, 2013
    #3
  4. Brian

    Lew Pitcher Guest

    On Sunday 24 March 2013 17:54, in comp.lang.c,
    wrote:

    > On 03/24/2013 05:25 PM, Brian wrote:
    >> 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


    --
    Lew Pitcher
    "In Skills, We Trust"
    Lew Pitcher, Mar 24, 2013
    #4
  5. Brian

    Brian Guest

    On Mar 24, 6:04 pm, Richard Damon <> wrote:
    > On 3/24/13 5:25 PM, Brian wrote:
    >
    > > 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

    >
    > 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.
    Brian, Mar 24, 2013
    #5
  6. Brian

    Öö Tiib Guest

    On Sunday, 24 March 2013 23:25:53 UTC+2, Brian wrote:
    > 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.

    >
    >
    >
    > Brian
    Öö Tiib, Mar 24, 2013
    #6
  7. Brian

    James Kuyper Guest

    On 03/24/2013 06:12 PM, Lew Pitcher wrote:
    > On Sunday 24 March 2013 17:54, in comp.lang.c,
    > wrote:
    >
    >> On 03/24/2013 05:25 PM, Brian wrote:
    >>> 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.
    --
    James Kuyper
    James Kuyper, Mar 24, 2013
    #7
  8. On Sunday, March 24, 2013 5:14:20 PM UTC-5, Brian wrote:
    > On Mar 24, 6:04 pm, Richard Damon <> wrote:
    >
    > > On 3/24/13 5:25 PM, Brian wrote:

    >
    > >

    >
    > > > 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

    >
    > >

    >
    > > 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.


    I'm guessing it's something similar to this:
    http://stackoverflow.com/questions/15157055/zoidberg-curve-cant-reach-zoidberg-solution

    But, Brian, we're all curious, what was the answer? What did you find?
    luser- -droog, Mar 25, 2013
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. buke2
    Replies:
    2
    Views:
    513
    buke2
    Jul 28, 2004
  2. Hendrik Greving

    design boolean equations

    Hendrik Greving, Jun 16, 2005, in forum: VHDL
    Replies:
    2
    Views:
    503
  3. Replies:
    1
    Views:
    1,111
    Roedy Green
    Nov 15, 2005
  4. munehiro

    parsing equations

    munehiro, Dec 9, 2003, in forum: Python
    Replies:
    4
    Views:
    492
    munehiro
    Dec 9, 2003
  5. Paddy McCarthy

    combining several lambda equations

    Paddy McCarthy, Feb 18, 2005, in forum: Python
    Replies:
    7
    Views:
    302
    Steven Bethard
    Feb 21, 2005
Loading...

Share This Page