@Test public void testAddAndSet() { final Vector3 u = new Vector3(1d, 2d, 3d); final Vector3 v = new Vector3(0.1d, 0.2d, 0.3d); final Vector3 t = new Vector3(); final Vector3 out = t.addAndSet(u, v); assertNotNull(out); assertTrue(out == t); assertEquals(1.1d, t.x, 0); assertEquals(2.2d, t.y, 0); assertEquals(3.3d, t.z, 0); }
@NonNull public Vector3 addAndSet(@NonNull Vector3 u, @NonNull Vector3 v) { x = u.x + v.x; y = u.y + v.y; z = u.z + v.z; return this; }
Vector3 implements Cloneable { @NonNull public Vector3 addAndSet(@NonNull Vector3 u, @NonNull Vector3 v) { x = u.x + v.x; y = u.y + v.y; z = u.z + v.z; return this; } }
Vector3 implements Cloneable { @NonNull public Vector3 addAndSet(@NonNull Vector3 u, @NonNull Vector3 v) { x = u.x + v.x; y = u.y + v.y; z = u.z + v.z; return this; } Vector3();  Vector3(double from);  Vector3(@NonNull Vector3 from);  Vector3(@NonNull @Size(min = 3) String[] values);  Vector3(@NonNull @Size(min = 3) double[] values);  Vector3(double x, double y, double z); }
Vector3 implements Cloneable { @NonNull public Vector3 addAndSet(@NonNull Vector3 u, @NonNull Vector3 v) { x = u.x + v.x; y = u.y + v.y; z = u.z + v.z; return this; } Vector3();  Vector3(double from);  Vector3(@NonNull Vector3 from);  Vector3(@NonNull @Size(min = 3) String[] values);  Vector3(@NonNull @Size(min = 3) double[] values);  Vector3(double x, double y, double z); Vector3 setAll(double x, double y, double z); @NonNull Vector3 setAll(@NonNull Vector3 other); @NonNull Vector3 setAll(@NonNull Axis axis); @NonNull Vector3 add(@NonNull Vector3 v); @NonNull Vector3 add(double x, double y, double z); @NonNull Vector3 add(double value); @NonNull Vector3 addAndSet(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull static Vector3 addAndCreate(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull Vector3 subtract(@NonNull Vector3 v); @NonNull Vector3 subtract(double x, double y, double z); @NonNull Vector3 subtract(double value); @NonNull Vector3 subtractAndSet(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull static Vector3 subtractAndCreate(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull Vector3 multiply(double value); @NonNull Vector3 multiply(@NonNull Vector3 v); @NonNull Vector3 multiply(@NonNull @Size(min = 16) double[] matrix); @NonNull Vector3 multiply(@NonNull Matrix4 matrix); @NonNull Vector3 multiplyAndSet(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull static Vector3 multiplyAndCreate(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull static Vector3 multiplyAndCreate(@NonNull Vector3 v, double value); @NonNull Vector3 divide(double value); @NonNull Vector3 divide(@NonNull Vector3 v); @NonNull Vector3 divideAndSet(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull Vector3 scaleAndSet(@NonNull Vector3 v, double b); @NonNull static Vector3 scaleAndCreate(@NonNull Vector3 u, double v); @NonNull Vector3 rotateBy(@NonNull Quaternion quaternion); @NonNull Vector3 rotateX(double angle); @NonNull Vector3 rotateY(double angle); @NonNull Vector3 rotateZ(double angle); double normalize(); static void orthoNormalize(@NonNull @Size(min = 2) Vector3[] vecs); static void orthoNormalize(@NonNull Vector3 v1, @NonNull Vector3 v2); @NonNull Vector3 inverse(); @NonNull Vector3 invertAndCreate(); static double length(double x, double y, double z); static double length(@NonNull Vector3 v); static double length2(@NonNull Vector3 v); static double length2(double x, double y, double z); double length(); double length2(); double distanceTo(@NonNull Vector3 v); double distanceTo(double x, double y, double z); static double distanceTo(@NonNull Vector3 u, @NonNull Vector3 v); static double distanceTo(double x1, double y1, double z1, double x2, double y2, double z2); double distanceTo2(@NonNull Vector3 v); double distanceTo2(double x, double y, double z); static double distanceTo2(@NonNull Vector3 u, @NonNull Vector3 v); static double distanceTo2(double x1, double y1, double z1, double x2, double y2, double z2); @NonNull Vector3 absoluteValue(); @NonNull Vector3 project(@NonNull Vector3 v); @NonNull Vector3 project(@NonNull @Size(min = 16) double[] matrix); @NonNull Vector3 project(@NonNull Matrix4 matrix); @NonNull static Vector3 projectAndCreate(@NonNull Vector3 u, @NonNull Vector3 v); double angle(@NonNull Vector3 v); static double dot(@NonNull Vector3 u, @NonNull Vector3 v); double dot(@NonNull Vector3 v); double dot(double x, double y, double z); static double dot(final double x1, final double y1, final double z1,
                             final double x2, final double y2, final double z2); @NonNull Vector3 cross(@NonNull Vector3 v); @NonNull Vector3 cross(double x, double y, double z); @NonNull Vector3 crossAndSet(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull static Vector3 crossAndCreate(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull Quaternion getRotationTo(@NonNull Vector3 direction); @NonNull Vector3 lerp(@NonNull Vector3 target, double t); @NonNull Vector3 lerpAndSet(@NonNull Vector3 from, @NonNull Vector3 to, double amount); @NonNull static Vector3 lerpAndCreate(@NonNull Vector3 from, @NonNull Vector3 to, double amount); @NonNull @Override Vector3 clone(); boolean isUnit(); boolean isUnit(double margin); boolean isZero(); boolean isZero(double margin); @NonNull static Vector3 getAxisVector(@NonNull Axis axis); @Override boolean equals(Object o); boolean equals(@NonNull Vector3 obj, double error); @NonNull @Size(min = 3) double[] toArray(@Size(min = 3) double[] array); @NonNull @Size(3) double[] toArray(); @NonNull @Override String toString(); }
Vector3 implements Cloneable { @NonNull public Vector3 addAndSet(@NonNull Vector3 u, @NonNull Vector3 v) { x = u.x + v.x; y = u.y + v.y; z = u.z + v.z; return this; } Vector3();  Vector3(double from);  Vector3(@NonNull Vector3 from);  Vector3(@NonNull @Size(min = 3) String[] values);  Vector3(@NonNull @Size(min = 3) double[] values);  Vector3(double x, double y, double z); Vector3 setAll(double x, double y, double z); @NonNull Vector3 setAll(@NonNull Vector3 other); @NonNull Vector3 setAll(@NonNull Axis axis); @NonNull Vector3 add(@NonNull Vector3 v); @NonNull Vector3 add(double x, double y, double z); @NonNull Vector3 add(double value); @NonNull Vector3 addAndSet(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull static Vector3 addAndCreate(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull Vector3 subtract(@NonNull Vector3 v); @NonNull Vector3 subtract(double x, double y, double z); @NonNull Vector3 subtract(double value); @NonNull Vector3 subtractAndSet(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull static Vector3 subtractAndCreate(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull Vector3 multiply(double value); @NonNull Vector3 multiply(@NonNull Vector3 v); @NonNull Vector3 multiply(@NonNull @Size(min = 16) double[] matrix); @NonNull Vector3 multiply(@NonNull Matrix4 matrix); @NonNull Vector3 multiplyAndSet(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull static Vector3 multiplyAndCreate(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull static Vector3 multiplyAndCreate(@NonNull Vector3 v, double value); @NonNull Vector3 divide(double value); @NonNull Vector3 divide(@NonNull Vector3 v); @NonNull Vector3 divideAndSet(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull Vector3 scaleAndSet(@NonNull Vector3 v, double b); @NonNull static Vector3 scaleAndCreate(@NonNull Vector3 u, double v); @NonNull Vector3 rotateBy(@NonNull Quaternion quaternion); @NonNull Vector3 rotateX(double angle); @NonNull Vector3 rotateY(double angle); @NonNull Vector3 rotateZ(double angle); double normalize(); static void orthoNormalize(@NonNull @Size(min = 2) Vector3[] vecs); static void orthoNormalize(@NonNull Vector3 v1, @NonNull Vector3 v2); @NonNull Vector3 inverse(); @NonNull Vector3 invertAndCreate(); static double length(double x, double y, double z); static double length(@NonNull Vector3 v); static double length2(@NonNull Vector3 v); static double length2(double x, double y, double z); double length(); double length2(); double distanceTo(@NonNull Vector3 v); double distanceTo(double x, double y, double z); static double distanceTo(@NonNull Vector3 u, @NonNull Vector3 v); static double distanceTo(double x1, double y1, double z1, double x2, double y2, double z2); double distanceTo2(@NonNull Vector3 v); double distanceTo2(double x, double y, double z); static double distanceTo2(@NonNull Vector3 u, @NonNull Vector3 v); static double distanceTo2(double x1, double y1, double z1, double x2, double y2, double z2); @NonNull Vector3 absoluteValue(); @NonNull Vector3 project(@NonNull Vector3 v); @NonNull Vector3 project(@NonNull @Size(min = 16) double[] matrix); @NonNull Vector3 project(@NonNull Matrix4 matrix); @NonNull static Vector3 projectAndCreate(@NonNull Vector3 u, @NonNull Vector3 v); double angle(@NonNull Vector3 v); static double dot(@NonNull Vector3 u, @NonNull Vector3 v); double dot(@NonNull Vector3 v); double dot(double x, double y, double z); static double dot(final double x1, final double y1, final double z1,
                             final double x2, final double y2, final double z2); @NonNull Vector3 cross(@NonNull Vector3 v); @NonNull Vector3 cross(double x, double y, double z); @NonNull Vector3 crossAndSet(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull static Vector3 crossAndCreate(@NonNull Vector3 u, @NonNull Vector3 v); @NonNull Quaternion getRotationTo(@NonNull Vector3 direction); @NonNull Vector3 lerp(@NonNull Vector3 target, double t); @NonNull Vector3 lerpAndSet(@NonNull Vector3 from, @NonNull Vector3 to, double amount); @NonNull static Vector3 lerpAndCreate(@NonNull Vector3 from, @NonNull Vector3 to, double amount); @NonNull @Override Vector3 clone(); boolean isUnit(); boolean isUnit(double margin); boolean isZero(); boolean isZero(double margin); @NonNull static Vector3 getAxisVector(@NonNull Axis axis); @Override boolean equals(Object o); boolean equals(@NonNull Vector3 obj, double error); @NonNull @Size(min = 3) double[] toArray(@Size(min = 3) double[] array); @NonNull @Size(3) double[] toArray(); @NonNull @Override String toString(); public double x; public double y; public double z; @NonNull
    static final Vector3 X; @NonNull
    static final Vector3 Y; @NonNull
    static final Vector3 Z; @NonNull
    static final Vector3 NEG_X; @NonNull
    static final Vector3 NEG_Y; @NonNull
    static final Vector3 NEG_Z; @NonNull
    static final Vector3 ZERO; @NonNull
    static final Vector3 ONE; }