A simple, fast graphing calculator for Android
Follows the latest Material 3 design guidelines and adapts to the system color (Material You)
Supports explicit and implicit functions and relations, polar functions, and parametric relations
This app utilises JNI to offload the graph point calculation to native C++ for extremely fast calculation of points (at least a few orders of magnitude improvement over Kotlin code in my own benchmarks). The basic layout of how it works is:
- (Steps)
- Function string input by user
- JNI function called: Function string, canvas geometry data, scale and offset are passed
- JNI performs C++ function call passing all the data
- C++ function returns std::vector containing point data
- JNI returns array of floats
- Points are plotted on Jetpack Compose Canvas
The exact working is slightly more complex, for example the C++ point calculation function analyses the function string to determine whether it is explicit, implicit, polar or parametric and performs the calculations accordingly, and also simplifies the graph if there are too many points to save memory and drawing time.
- This app uses ExprTk to evaluate mathematical expressions. Thanks to Arash Partow for creating this library.