Hey, I'm a little confused when it comes to Kotlin...
# mathematics
f
Hey, I'm a little confused when it comes to Kotlin math libs. I'm looking for a good library to use for 3D graphics (matrix multiplications etc). There is kmath by romain guy, multik by Kotlin itself, korlibs-math, and some others. So which one fits best?
a
It depends on the specifics of your needs. If you need only matrix multiplication - multik will be fine. KMath is much larger framework, that integrates a lot of mathematical tools such as matrix decomposition, integration, optimization etc. Korlibs is very limited, it is design mostly to support Korge and 2D graphics.
The ultimate goal is to make KMath-geometry a good library for graphics. It actually has some tools that you need for 3D like Euler angles transformation. But we do not have a lot of manpower to advance it fast. So contributions are welcome.
We currently successfully use KMath-geometry for 2D cartography and for 3D simulations. But documentation is lacking.
f
Interesting, thank you. I'm hoping for proper Kotlin value classes soon so we won't have to painfully pay an object allocation for each small vector/matrix.
a
It won't make any difference. The price you pay for classes is minuscule. You can note the difference for tons of vectors, of course, but I have not noticed it. Kotlin value classes won't help you with lists of vectors.