Back to project page fun-gl.
The source code is released under:
Apache License
If you think the Android project fun-gl listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.jcxavier.android.opengl.math; /*from w w w . j ava 2s. c o m*/ /** * Created on 11/03/2014. * * @author Joo Xavier <jcxavier@jcxavier.com> */ public final class Vector2 implements IVector<Vector2> { public float x; public float y; public Vector2() { x = 0; y = 0; } public Vector2(final float x, final float y) { this.x = x; this.y = y; } public Vector2(final Vector2 v) { x = v.x; y = v.y; } @Override public final Vector2 set(final Vector2 v) { x = v.x; y = v.y; return this; } public Vector2 set(final float x, final float y) { this.x = x; this.y = y; return this; } @Override public Vector2 add(final Vector2 v) { return set(x + v.x, y + v.y); } @Override public Vector2 sub(final Vector2 v) { return set(x - v.x, y - v.y); } @Override public Vector2 negate() { return set(-x, -y); } }