Java Code Examples for org.apache.commons.math.exception.util.LocalizedFormats#CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR
The following examples show how to use
org.apache.commons.math.exception.util.LocalizedFormats#CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Math_55_Vector3D_t.java From coming with MIT License | 5 votes |
/** Get a normalized vector aligned with the instance. * @return a new normalized vector * @exception ArithmeticException if the norm is zero */ public Vector3D normalize() { double s = getNorm(); if (s == 0) { throw new MathArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR); } return scalarMultiply(1 / s); }
Example 2
Source File: Math_55_Vector3D_s.java From coming with MIT License | 5 votes |
/** Get a normalized vector aligned with the instance. * @return a new normalized vector * @exception ArithmeticException if the norm is zero */ public Vector3D normalize() { double s = getNorm(); if (s == 0) { throw new MathArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR); } return scalarMultiply(1 / s); }
Example 3
Source File: Vector3D_s.java From coming with MIT License | 5 votes |
/** Get a normalized vector aligned with the instance. * @return a new normalized vector * @exception ArithmeticException if the norm is zero */ public Vector3D normalize() { double s = getNorm(); if (s == 0) { throw new MathArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR); } return scalarMultiply(1 / s); }
Example 4
Source File: Vector3D_t.java From coming with MIT License | 5 votes |
/** Get a normalized vector aligned with the instance. * @return a new normalized vector * @exception ArithmeticException if the norm is zero */ public Vector3D normalize() { double s = getNorm(); if (s == 0) { throw new MathArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR); } return scalarMultiply(1 / s); }
Example 5
Source File: Vector3D.java From astor with GNU General Public License v2.0 | 5 votes |
/** Get a normalized vector aligned with the instance. * @return a new normalized vector * @exception ArithmeticException if the norm is zero */ public Vector3D normalize() { double s = getNorm(); if (s == 0) { throw new MathArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR); } return scalarMultiply(1 / s); }
Example 6
Source File: Vector1D.java From astor with GNU General Public License v2.0 | 5 votes |
/** {@inheritDoc} */ public Vector1D normalize() { double s = getNorm(); if (s == 0) { throw new MathArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR); } return scalarMultiply(1 / s); }
Example 7
Source File: Vector3D.java From astor with GNU General Public License v2.0 | 5 votes |
/** {@inheritDoc} */ public Vector3D normalize() { double s = getNorm(); if (s == 0) { throw new MathArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR); } return scalarMultiply(1 / s); }
Example 8
Source File: Vector2D.java From astor with GNU General Public License v2.0 | 5 votes |
/** {@inheritDoc} */ public Vector2D normalize() { double s = getNorm(); if (s == 0) { throw new MathArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR); } return scalarMultiply(1 / s); }
Example 9
Source File: Vector1D.java From astor with GNU General Public License v2.0 | 5 votes |
/** {@inheritDoc} */ public Vector1D normalize() { double s = getNorm(); if (s == 0) { throw new MathArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR); } return scalarMultiply(1 / s); }
Example 10
Source File: Vector3D.java From astor with GNU General Public License v2.0 | 5 votes |
/** {@inheritDoc} */ public Vector3D normalize() { double s = getNorm(); if (s == 0) { throw new MathArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR); } return scalarMultiply(1 / s); }
Example 11
Source File: Vector2D.java From astor with GNU General Public License v2.0 | 5 votes |
/** {@inheritDoc} */ public Vector2D normalize() { double s = getNorm(); if (s == 0) { throw new MathArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR); } return scalarMultiply(1 / s); }