Created
September 7, 2017 10:48
-
-
Save njlr/cf688eacf609154c004123711b94fa36 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public final class Vector2 { | |
| public final float x; | |
| public final float y; | |
| public Vector2(float x, float y) { | |
| this.x = x; | |
| this.y = y; | |
| } | |
| public Vector2 add(final Vector2 v) { | |
| return new Vector2(x + v.x, y + v.y); | |
| } | |
| // toString, hashCode, equals… | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment