Converting C# to Java

Started by
1 comment, last by kyanite 11 years, 10 months ago
I'm attempting to convert my C# project that I have been working on to Java.
I'll have more questions as I am converting it, but what is the Java equivalent of a Vector2 in C#? Will it require a framework or API?
Advertisement
There is none in either language.

There are many graphics packages (including one by Sun) that define their own numeric vector classes.

That said, if you are using XNA or some other library for your graphics, it almost certainly contains numeric vector classes. The same holds true for Java and 3D packages available in it.
In the vanilla JDK there is no such thing, although it is fairly easy to roll your own.

That said, there are plenty of 3rd party options. LibGDX, JME, et. al. all have their own [internal] math libraries you can use if you'd like. The easiest would probably be to use the Vecmath (javax.vecmath) package, which is a standalone library that was liberated from J3D. There are many ways to obtain it (package managers, Maven, etc.), but it's homepage for the source is here: http://java.net/projects/vecmath. The corresponding class to C#'s Vector2 would be Vector2f.

This topic is closed to new replies.

Advertisement