views:

40

answers:

1

I'm trying to draw equations to the screen. Not the graphs or sth just the equation, but in a "pretty" way (f.e. like they look on wikipedia ). I've done some research but could find a "build-in-way", but maybe i overlooked something?!?

So i've decided to draw them by myself. I'm not very experienced, so don't blaim me if my idea is completely idiotic...

I thought of two ways. Either i create one UIView subclass hand in the formula as string, parse it and handle all the drawing in that view. Or i create individual subclasses for each type of mathematical expression and hand in the apropriate parts (f.e numerator and denominator for a fraction). and those parts can be either of those subclasses... f.e. a (square)-root-subclass would get the part under the root and draws the root-sign at the appropriate place in the appropriate size...

is one of this ways any good? or if some knows an better/easier way to solve this, pls let me know.

would help me alot, thanks

+2  A: 

Just pour a MathML expression into a UIWebView.

Alex Reynolds
thanks for the quick answer, that would be my backup-plan. but i'd like to have more flexibility, to manipulate them onscreen.
Tobi
You're looking at managing a fairly complex object graph, comprised of layers of graphical elements. Not impossible, but it would be a fair amount of work.
Alex Reynolds
As can be seen on the linked photo, the rendering of MathML expressions in the current Webkit is not exactly adequate. Just look at the second expression (y_i = ...): the fraction is displaced quite a bit from the correct position.
mrueg