How do I import Vector2D

Started by
1 comment, last by SelethD 11 years, 2 months ago

I need to do some vector operations on a 2d Asteroids type game.

I found this page here.....

http://geom-java.sourceforge.net/api/math/geom2d/Vector2D.html

Unfortunately, I have no idea what to 'import' to get this to work.

I saw in an online example someone used the following....

import math.geom2d.Vector2D;

when I tried this, I only got....

error: package math.geom2d does not exist
import math.geom2d.Vector2D;

I am totally new to Java, and im not sure what I am doing wrong, other than there might be something I need to download extra?

And if so... how will others run my java app or applet if they too dont have the 'something' i might be missing?

Thanks for any help

Advertisement

Yes, you need to download and install the geom-java package, as it is not part of the standard Java library. You should then be able to either state it as a requirement for future users, or perhaps even bundle it along with your java program (subject to conditions).

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

ok, thank you so much.

This topic is closed to new replies.

Advertisement