Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I need a (simple), immutable, 2D vector library for Java or Scala

Tags:

java

scala

vector

I've been searching for a whole day. I've tried Simplex3D Scala library. But it's poorly documented and I don't even manage to get a vector normalized after downloading an older release because the current one doesn't run.

javax.vecmath is not immutable so it not nice to use in Scala.

commons-math is more into the scientific math direction with no convenience for 2D (or 3D) use.

like image 990
ziggystar Avatar asked Apr 21 '26 10:04

ziggystar


2 Answers

I couldn't find one when I needed one. So I built one, and I've always been intending to release it. I'm too busy to do anything with it now, but I could probably make it available next week if a better answer is not forthcoming.

like image 170
Rex Kerr Avatar answered Apr 24 '26 00:04

Rex Kerr


I've just done some more research. Slick2D seems to contain a Vector2f class that has immutable methods. Though that's not very much and can be done by hand in maybe an hour.

like image 34
ziggystar Avatar answered Apr 24 '26 00:04

ziggystar