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
altavir
11/14/2024, 5:23 AM
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.
altavir
11/14/2024, 5:24 AM
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
Fudge
11/14/2024, 8:07 AM
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
altavir
11/14/2024, 5:47 PM
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.