FieldVector3D implements Serializable { public FieldVector3D<T> normalize() throws MathArithmeticException { final T s = getNorm(); if (s.getReal() == 0) { throw new MathArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR); } return scalarMultiply(s.reciprocal()); } FieldVector3D(final T x, final T y, final T z);  FieldVector3D(final T[] v);  FieldVector3D(final T alpha, final T delta);  FieldVector3D(final T a, final FieldVector3D<T>u);  FieldVector3D(final T a, final Vector3D u);  FieldVector3D(final double a, final FieldVector3D<T> u);  FieldVector3D(final T a1, final FieldVector3D<T> u1,
                         final T a2, final FieldVector3D<T> u2);  FieldVector3D(final T a1, final Vector3D u1,
                         final T a2, final Vector3D u2);  FieldVector3D(final double a1, final FieldVector3D<T> u1,
                         final double a2, final FieldVector3D<T> u2);  FieldVector3D(final T a1, final FieldVector3D<T> u1,
                         final T a2, final FieldVector3D<T> u2,
                         final T a3, final FieldVector3D<T> u3);  FieldVector3D(final T a1, final Vector3D u1,
                         final T a2, final Vector3D u2,
                         final T a3, final Vector3D u3);  FieldVector3D(final double a1, final FieldVector3D<T> u1,
                         final double a2, final FieldVector3D<T> u2,
                         final double a3, final FieldVector3D<T> u3);  FieldVector3D(final T a1, final FieldVector3D<T> u1,
                         final T a2, final FieldVector3D<T> u2,
                         final T a3, final FieldVector3D<T> u3,
                         final T a4, final FieldVector3D<T> u4);  FieldVector3D(final T a1, final Vector3D u1,
                         final T a2, final Vector3D u2,
                         final T a3, final Vector3D u3,
                         final T a4, final Vector3D u4);  FieldVector3D(final double a1, final FieldVector3D<T> u1,
                         final double a2, final FieldVector3D<T> u2,
                         final double a3, final FieldVector3D<T> u3,
                         final double a4, final FieldVector3D<T> u4); T getX(); T getY(); T getZ(); T[] toArray(); Vector3D toVector3D(); T getNorm1(); T getNorm(); T getNormSq(); T getNormInf(); T getAlpha(); T getDelta(); FieldVector3D<T> add(final FieldVector3D<T> v); FieldVector3D<T> add(final Vector3D v); FieldVector3D<T> add(final T factor, final FieldVector3D<T> v); FieldVector3D<T> add(final T factor, final Vector3D v); FieldVector3D<T> add(final double factor, final FieldVector3D<T> v); FieldVector3D<T> add(final double factor, final Vector3D v); FieldVector3D<T> subtract(final FieldVector3D<T> v); FieldVector3D<T> subtract(final Vector3D v); FieldVector3D<T> subtract(final T factor, final FieldVector3D<T> v); FieldVector3D<T> subtract(final T factor, final Vector3D v); FieldVector3D<T> subtract(final double factor, final FieldVector3D<T> v); FieldVector3D<T> subtract(final double factor, final Vector3D v); FieldVector3D<T> normalize(); FieldVector3D<T> orthogonal(); static T angle(final FieldVector3D<T> v1, final FieldVector3D<T> v2); static T angle(final FieldVector3D<T> v1, final Vector3D v2); static T angle(final Vector3D v1, final FieldVector3D<T> v2); FieldVector3D<T> negate(); FieldVector3D<T> scalarMultiply(final T a); FieldVector3D<T> scalarMultiply(final double a); boolean isNaN(); boolean isInfinite(); @Override boolean equals(Object other); @Override int hashCode(); T dotProduct(final FieldVector3D<T> v); T dotProduct(final Vector3D v); FieldVector3D<T> crossProduct(final FieldVector3D<T> v); FieldVector3D<T> crossProduct(final Vector3D v); T distance1(final FieldVector3D<T> v); T distance1(final Vector3D v); T distance(final FieldVector3D<T> v); T distance(final Vector3D v); T distanceInf(final FieldVector3D<T> v); T distanceInf(final Vector3D v); T distanceSq(final FieldVector3D<T> v); T distanceSq(final Vector3D v); static T dotProduct(final FieldVector3D<T> v1,
                                                                   final FieldVector3D<T> v2); static T dotProduct(final FieldVector3D<T> v1,
                                                                   final Vector3D v2); static T dotProduct(final Vector3D v1,
                                                                   final FieldVector3D<T> v2); static FieldVector3D<T> crossProduct(final FieldVector3D<T> v1,
                                                                                    final FieldVector3D<T> v2); static FieldVector3D<T> crossProduct(final FieldVector3D<T> v1,
                                                                                    final Vector3D v2); static FieldVector3D<T> crossProduct(final Vector3D v1,
                                                                                    final FieldVector3D<T> v2); static T distance1(final FieldVector3D<T> v1,
                                                                  final FieldVector3D<T> v2); static T distance1(final FieldVector3D<T> v1,
                                                                  final Vector3D v2); static T distance1(final Vector3D v1,
                                                                  final FieldVector3D<T> v2); static T distance(final FieldVector3D<T> v1,
                                                                 final FieldVector3D<T> v2); static T distance(final FieldVector3D<T> v1,
                                                                 final Vector3D v2); static T distance(final Vector3D v1,
                                                                 final FieldVector3D<T> v2); static T distanceInf(final FieldVector3D<T> v1,
                                                                    final FieldVector3D<T> v2); static T distanceInf(final FieldVector3D<T> v1,
                                                                    final Vector3D v2); static T distanceInf(final Vector3D v1,
                                                                    final FieldVector3D<T> v2); static T distanceSq(final FieldVector3D<T> v1,
                                                                   final FieldVector3D<T> v2); static T distanceSq(final FieldVector3D<T> v1,
                                                                   final Vector3D v2); static T distanceSq(final Vector3D v1,
                                                                   final FieldVector3D<T> v2); @Override String toString(); String toString(final NumberFormat format);  }
@Test public void testNormalize() throws MathArithmeticException { Assert.assertEquals(1.0, createVector(5, -4, 2, 3).normalize().getNorm().getReal(), 1.0e-12); try { createVector(0, 0, 0, 3).normalize(); Assert.fail("an exception should have been thrown"); } catch (MathArithmeticException ae) { } }