18
u/daklakian Jan 31 '20
I haven't tried the app yet but the video demo looks amazing! Great work!
5
u/TheLartians Jan 31 '20
Thanks! I hacked the preview together in about an hour with screen recording and apple motion. Also really happy how that turned out.
6
u/dynamitegamer1 Jan 31 '20
That demo only took an hour? Most companies who put out commercials or demos that they spend weeks on don't look even half as good as that!
4
u/TheLartians Jan 31 '20
Hah good to know the skills I learned during my awkward high school film projects actually paid off!
But seriously Motion is a great program for simple app previews like this one and imo quite easy to use if you've ever worked with Photoshop or similar.
2
u/dynamitegamer1 Jan 31 '20
Actually I took Photoshop and got certified in highschool, and learned illustrator in class as well. So I'll definitely have to look into this program, thanks for the tip!
10
u/realblingy Jan 31 '20
Wow! As a math tutor, I could see big potential with this app. It could definitely make learning Maths easier and would be an amazing tool for high school students. Keep it up!
3
u/TheLartians Jan 31 '20
That's awesome, thanks! Yeah I really hope this will help students understand math. I especially hope it can reach those that are scared of expressions and algebra (I have some friends like that that I'm planning to
torturetest the App with soon).Do you think there are some important features or topics that could be added to allow tutors to utilise the app with their students?
4
2
2
u/TOMAHAWK_____CHOP Jan 31 '20
Wow. I can't even begin to comprehend the difficulties in getting everything functioning properly. Nice job
2
u/TheLartians Jan 31 '20
Just remember to unit test and modularise components whenever possible. That way you can add complexity without getting too messy.
2
u/deftonechromosome Jan 31 '20
That looks brilliant dude
1
u/TheLartians Jan 31 '20
Thanks, man!
1
u/deftonechromosome Jan 31 '20
Just downloaded. It looks genuinely clever look fwd to trying it
1
2
2
u/wcandillon Feb 01 '20
This is amazing u/TheLartians. I'm playing with it now. So the gestures and animations in the equations are just done with OpenGL?
2
u/TheLartians Feb 01 '20
Thanks! Well yeah, the rendering of the equations is done through OpenGL, while the gesture and equation logic is implemented in C++. That way we can have both optimal performance and a single codebase that runs literally anywhere.
React-naive is then used to create the platform-specific native UI elements around it.
1
Feb 02 '20
Isn't openGL deprecated on iOS 13? Would this affect your app?
2
u/TheLartians Feb 02 '20
Yeah it’s deprecated, but still works on all devices for now. Once Apple pulls the plug we will probably need to switch to something like Vulcan as our cross-platform rendering framework. Annoyingly, we will also have to keep supporting OpenGL as well, since many devices don’t support Vulcan.
1
3
u/tech-god Jan 31 '20
I have no idea how you coded together the drag and drop math UI, and the business logic to make sure the algebra is always correct. Mind boggling. Could you offer any direction on how one would go about making this?
4
u/TheLartians Jan 31 '20 edited Jan 31 '20
heh, I'll try to boil down the logic as good as I can. I built most components (besides the react part) from scratch in order to have the highest amount control and to learn a lot while doing so too.
The core of the project is a small computer algebra system that I wrote specifically for term manipulation which is able to generate human-readable step-by-step solutions. These solutions are needed to rate user solutions and display the guide. Writing that is a whole story of it's own but it boils down to commutative-associative pattern matching and a lot of unit testing.
Once the algebra system was working, I needed to write a representation for the expressions that can be rendered and manipulated in real time. I chose a tree representation where the individual nodes can have individual purposes. For example some nodes have affine transformations associated with them, others can be rendered. By stringing them together and writing a custom renderer and gesture recogniser we can build a representation of an expression that can be rendered and manipulated with drag and drop gestures. Text is rendered through signed distance fields to be sharp at every scale and resolution.
Once a gesture is detected (e.g. drop x on -x inside a sum) I use the algebra system to find a valid possible transformation. The result of the transformation is then used to rebuild the expression tree. That way I can ensure the algebra to stay correct in every step.
I hope this helps you get an idea. I'd say the most important aspects are patience, passion and willingness to learn and experiment a lot to manage such a project.
1
u/mkuti Feb 01 '20
Nice app. Quick one. Are the questions dynamically generated or predefined in the app?
2
u/TheLartians Feb 01 '20
Thanks! Currently we generate the questions dynamically beforehand and ship them as a pool with the app. Having them baked will allow us to reason better about their difficulty and allow a more adaptive selection in the future.
0
10
u/TheLartians Jan 31 '20 edited Feb 01 '20
Hey everyone,
After working for almost two years developing an interactive algebra practice App in pure C++ and OpenGL I’ve decided to add react-native to our toolset and am incredibly happy with that decision. Finally we can access the huge ecosystem of react projects instead of re-inventing the wheel for every new feature we introduce.
Maphi allows students to practice working with mathematical expressions and find their own solutions with simple drag and drop gestures. We are also planning on adding more advanced topics like derivatives in the future.
Anything algebra or expression-rendering related is still in C++ and OpenGL. Bridging the C++ code to react-native on iOS was a charm as we could define the full native interface in Objective-C++, a language that allows mixing C++ and Objective C code. Android is a bit more complex, as we first need to bridge the C++ code to Java and then from Java to react-native. We are expecting to release the new Android version next month.
Some tech used:
RN v0.60
C++ / OpenGL ES
TypeScript
react-navigation
react-redux
redux-persist
react-i18next
react-native-sound
react-native-haptic-feedback
react-native-svg
react-native-iap
App Store: https://apps.apple.com/us/app/maphi-the-math-app/id1276181580
Feel free to ask me anything development or app related. I would also love to hear your Feedback on the product!
edit: wow my first gold! thanks!