How to make math equations in Xcode?
Asked Answered
E

2

3

I am a total beginner with Xcode and Objective C, but I have some experience with OOP in C++. I bought this book. I read about how to make a simple app, and skimmed the rest of the book. What I want to do is make an iPhone app people can use to look up math equations such as the quadratic eqauation, pythagorean identity, etc. I plan to include a lot of stuff, and do a lot of things better than other apps I have seen. However, before I pay Apple $99 to be a full fledged iOS developer, I want to know that it isn't too hard to make the Greek letters and Math notation that we see in math books. So for example, what code is needed to make an iPhone app that display enter image description here. Of course I want to use features that I understand are included in Xcode for doing this sort of thing, rather than, make a graphic with another program that my app would use when needed. Besides that specific example, where is the Apple documentation for making other math symbols and notation that my iPhone app will display? If this is the wrong place to ask, it would be great if you could tell me of a beter place to post my question.

Economic answered 4/11, 2012 at 1:51 Comment(2)
possible duplicate of Drawing formulas with Quartz 2dCrapulous
Take a look at github.com/kostub/iosMathCounterpoise
G
1

It's going to require a lot of writing to get good layouts using the system frameworks. All the building blocks are there, but your program would need significant rendering customization to get the layouts you expect. In detail, the characters you need are there, but you will need to write a bunch of supporting code in order to resize, position, and layout these characters correctly.

You may want to look for a suitably licensed library you can use which specializes in this purpose. Perhaps a LaTeX renderer would offer some good leads.

Groundsel answered 4/11, 2012 at 2:3 Comment(2)
I do all my math with Mathematica and it allows me to save any content in a LaTeX (.tex) file. Mathematica also allows me to save any content to a MathML (.mml) file. I can also save any content as a XHTMLathML which the Mathematica documentation says is XHTML with embedded MathML. Some of the examples at [this MathML Browser Test] don't so good on my iPhone, so I wouldn't want to rely completely on MathML. What are the trade offs between using the different formats, and can I mix formats in the same app.Economic
@TedErsek i'm not qualified to answer that ;) i recommend you ask a new question. you might also consider asking here: tex.stackexchange.com good luck!Groundsel
G
1

Use core animiation layers to construct the elements of a parsed equation. Use Quartz to draw lines, symbols, for rendering visual elments of the operation with the equation. Also use Core Plot. And then eventually output to Latex once parsed into hierarchical data structure. Also check out Graham Cox's GCMathParser.

Similar question: Drawing formulas with Quartz 2d

Garda answered 4/11, 2012 at 2:2 Comment(0)
G
1

It's going to require a lot of writing to get good layouts using the system frameworks. All the building blocks are there, but your program would need significant rendering customization to get the layouts you expect. In detail, the characters you need are there, but you will need to write a bunch of supporting code in order to resize, position, and layout these characters correctly.

You may want to look for a suitably licensed library you can use which specializes in this purpose. Perhaps a LaTeX renderer would offer some good leads.

Groundsel answered 4/11, 2012 at 2:3 Comment(2)
I do all my math with Mathematica and it allows me to save any content in a LaTeX (.tex) file. Mathematica also allows me to save any content to a MathML (.mml) file. I can also save any content as a XHTMLathML which the Mathematica documentation says is XHTML with embedded MathML. Some of the examples at [this MathML Browser Test] don't so good on my iPhone, so I wouldn't want to rely completely on MathML. What are the trade offs between using the different formats, and can I mix formats in the same app.Economic
@TedErsek i'm not qualified to answer that ;) i recommend you ask a new question. you might also consider asking here: tex.stackexchange.com good luck!Groundsel

© 2022 - 2024 — McMap. All rights reserved.