Skip to content

Instantly share code, notes, and snippets.

@njlr
Created September 7, 2017 10:52
Show Gist options
  • Select an option

  • Save njlr/ce12d64d79f8c4d7bf1ac5a045417dfd to your computer and use it in GitHub Desktop.

Select an option

Save njlr/ce12d64d79f8c4d7bf1ac5a045417dfd to your computer and use it in GitHub Desktop.
public final class Vector3 {
 
 public final float x;
  public final float y;
 public final float z;
 
  public Vector3(float x, float y, float z) {
  this.x = x;
  this.y = y;
  this.z = z;
  }
 
  public Vector3 add(final Vector3 v) {
 return new Vector2(x + v.x, y + v.y, z + v.z);
  }
 
  // toString, hashCode, equals...
}
@kingter

kingter commented Sep 4, 2018

Copy link
Copy Markdown

Looks like there is a typo, at L14. Vector2 -> Vector3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment