Does anyone know if there are any existing maths packages for Java. There is a Vector class in 1.5 but it has nothing to do with vectors.

What I'm looking for is something along the line of a Scalar class with a ScalarMaths class. Then a Vector2D/Maths class etc.

I need it for a game I'm writing (finally getting around to that now my coursework is done for a few weeks). I'll quite happily implement it myself but wanted to check if anyone knows of an existing package. Google tends to leave me looking at mountains of hits for the aforementioned Vector class (which is just a collection).

>>
There is a Vector class in 1.5 but it has nothing to do with vectors.
>>

Thats just a type of array that will allow hold different 'types'. Along with built in methods for access.

As i remember it, java has had built in math from the beginning, which, of course, has just been going through progressive development over time.

>>
Google tends to leave me looking at mountains of hits for the aforementioned Vector class (which is just a collection).
>>

Thats because, thats what they mean by a vector.

You probably need to get a hold of a graphical app along the lines of what you want to do. One with the souces available, and just use that as a kind of example, to see what classes their using for their math.

It has a Maths class but it doesn't do what I want. I should have been more specific in the title. At the moment it has good support for scalar mathematics but I've seen nothing that looks like i,j,k vector mathematics.

I'm hoping to simplify all the movement in a game by simply using vectors. So a displacement would just be done by adding 2 vectors together and such. Just takes all the work out of implementation for future by bundling the motion into one package that can then just be used repeatedly.

For what I'm working on it would probably be easier to just dump such considerations directly into the game but it would spoil my sense of aesthetics .

I used to have a java applet that did a 'asteroids' type of game. It was created around 1.0, but worked really well. And had another thing that just faded in with a banner that said water, with lapping water as a back drop. They were both good small programs and were in windows. I guess if you could find something that exists that is close to what you want to do, and the source is available ... it might contain some hints. Even to possibly extend an existing class ?

Have a look at the Java3D package. That's oriented towards 3D graphics and has (amongst other things) a javax.vecmath package which contains various point, vector2D and vector3D classes along with manipulation methods, invertions, quaternions and lots more. Just about everything you need for graphics manipulation.

Java3D has been OS for quite a while now after Sun let it go (they are focusing more on jogl), and we're up to version 1.5 beta

I'll have a look. According to that site the vecmath project is under the JRL. I'll have to have a read of it, I'd be hoping to strip it out and put it directly in a package if at all possible. I'd rather not have to force people to install all of Java3D.