Rendering math equations

This is a discussion on Rendering math equations within the Game Programming forums, part of the General Programming Boards category; Is there a library for rendering mathematical equations? The way Microsoft Word Equation Editor works. I looked at Wikipedia's LaTeX ...

  1. #1
    glo
    glo is offline
    Registered User
    Join Date
    May 2006
    Posts
    169

    Rendering math equations

    Is there a library for rendering mathematical equations? The way Microsoft Word Equation Editor works.
    I looked at Wikipedia's LaTeX images and Firefox MathML renderer and both seem to produce good equations, but what does it take to render those?

  2. #2
    Registered User
    Join Date
    Mar 2007
    Posts
    416
    Are you talking about graphing equations? I made a program for graphic parametric equations for a course i took and it's roughly 1300 lines of code, although it cannot plot very sophisticated equations, it'll still plot sin/cos functions. If you want to see if it's in my signature. Also, I do not know of any library that is specifically used for plotting functions, sorry I can't be of any help there.

  3. #3
    glo
    glo is offline
    Registered User
    Join Date
    May 2006
    Posts
    169
    Hi scwizzo,

    I'm after rendering mathematical expressions as in
    Code:
    4^2
    ---  =  8
     2
    But graphically, the way Wikipedia does it.

  4. #4
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    What is the application? LaTeX is great but it's better suited for static output. You quite literally have to compile the expression and generate an output file (ps, eps, pdf, etc...). Then you can render the output file using a regular rendering library.

    If you want something more dynamic (like an editor) LaTeX probably isn't a great idea. I'm not sure how MathML rendering works.

  5. #5
    glo
    glo is offline
    Registered User
    Join Date
    May 2006
    Posts
    169
    I need it dynamic to some extent - although I won't need to edit expressions in a WYSIWYG manner, I do want to be able to pass a LaTeX like syntax string to a function and be able to render it.
    This should allow me to render math expressions on say, a wxWidgets application.

  6. #6
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Well if you don't mind a delay, just generate a latex expression from whatever the application input is, write it to a file, fork off a latex command to generate an ps file, then use a ps library to render the resulting file in your window.

    Basically all of the hard parts are handled for you, you just need to write the code that glues it all to your application.

  7. #7
    glo
    glo is offline
    Registered User
    Join Date
    May 2006
    Posts
    169
    Yes it seemed like a way to do it at first, only then I realised that I'll need a TeX engine that weighs hundreds of mbs?

  8. #8
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    or assume one exists on the system and just list it as a dependency. For linux, all major distros will have a latex package in their source tree. For windows, an extra couple hundred megs is good punishment :P

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Math equations not working
    By MaaaTtY in forum C++ Programming
    Replies: 3
    Last Post: 03-09-2009, 04:40 AM
  2. how to use operator+() in this code?
    By barlas in forum C++ Programming
    Replies: 10
    Last Post: 07-09-2005, 07:22 PM
  3. Math equations
    By C-Struggler in forum C Programming
    Replies: 6
    Last Post: 04-05-2003, 07:21 AM
  4. voxel based rendering
    By Silvercord in forum Game Programming
    Replies: 1
    Last Post: 03-20-2003, 04:14 PM
  5. Replies: 7
    Last Post: 02-12-2003, 10:43 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21