Tabnine Logo
MathLib.sqrt
Code IndexAdd Tabnine to your IDE (free)

How to use
sqrt
method
in
javolution.lang.MathLib

Best Java code snippets using javolution.lang.MathLib.sqrt (Showing top 10 results out of 315)

origin: org.jscience/jscience

/**
 * Returns the {@link #norm()} value of this vector.
 *
 * @return <code>this.norm().doubleValue()</code>.
 */
public double normValue() {
  double normSquared = 0;
  for (int i = _dimension; --i >= 0;) {
    double values = _values[i];
    normSquared += values * values;
  }
  return MathLib.sqrt(normSquared);
}
origin: org.jscience/jscience

/**
 * Returns the magnitude of this complex number, also referred to
 * as the "modulus" or "length".
 *
 * @return the magnitude of this complex number.
 */
public double magnitude() {
  return MathLib.sqrt(_real * _real + _imaginary * _imaginary);
}
origin: org.jscience/jscience

/**
 * Returns the positive square root of this number.
 *
 * @return <code>sqrt(this)</code>.
 */
public Float64 sqrt() {
  Float64 r = FACTORY.object();
  r._value = MathLib.sqrt(this._value);
  return r;
}
origin: javolution/javolution

/**
 * Returns the arc sine of the specified value, 
 * in the range of -<i>pi</i>/2 through <i>pi</i>/2. 
 *
 * @param x the value whose arc sine is to be returned.
 * @return the arc sine in radians for the specified value.
 **/
public static double asin(double x) {
  if (x < -1.0 || x > 1.0)
    return MathLib.NaN;
  if (x == -1.0)
    return -HALF_PI;
  if (x == 1.0)
    return HALF_PI;
  return MathLib.atan(x / MathLib.sqrt(1.0 - x * x));
}
/**/
origin: apache/marmotta

/**
 * Returns the arc sine of the specified value, 
 * in the range of -<i>pi</i>/2 through <i>pi</i>/2. 
 *
 * @param x the value whose arc sine is to be returned.
 * @return the arc sine in radians for the specified value.
 **/
public static double asin(double x) {
  if (x < -1.0 || x > 1.0)
    return MathLib.NaN;
  if (x == -1.0)
    return -HALF_PI;
  if (x == 1.0)
    return HALF_PI;
  return MathLib.atan(x / MathLib.sqrt(1.0 - x * x));
}
origin: org.apache.marmotta/marmotta-commons

/**
 * Returns the arc sine of the specified value, 
 * in the range of -<i>pi</i>/2 through <i>pi</i>/2. 
 *
 * @param x the value whose arc sine is to be returned.
 * @return the arc sine in radians for the specified value.
 **/
public static double asin(double x) {
  if (x < -1.0 || x > 1.0)
    return MathLib.NaN;
  if (x == -1.0)
    return -HALF_PI;
  if (x == 1.0)
    return HALF_PI;
  return MathLib.atan(x / MathLib.sqrt(1.0 - x * x));
}
origin: org.javolution/javolution-core-java

/**
 * Returns the arc sine of the specified value, 
 * in the range of -<i>pi</i>/2 through <i>pi</i>/2. 
 *
 * @param x the value whose arc sine is to be returned.
 * @return the arc sine in radians for the specified value.
 **/
public static double asin(double x) {
  if (x < -1.0 || x > 1.0)
    return MathLib.NaN;
  if (x == -1.0)
    return -HALF_PI;
  if (x == 1.0)
    return HALF_PI;
  return MathLib.atan(x / MathLib.sqrt(1.0 - x * x));
}
origin: org.jscience/jscience

/**
 * Returns the square root of this measure.
 *
 * @return <code>sqrt(this)</code>
 * 
 */
public Amount<? extends Quantity> sqrt() {
  Amount<Q> m = Amount.newInstance(_unit.root(2));
  if (this._isExact) {
    double sqrtDouble = MathLib.sqrt(_exactValue);
    long sqrtLong = (long) sqrtDouble;
    if (sqrtLong * sqrtLong == _exactValue)
      return m.setExact(sqrtLong);
  }
  double min = MathLib.sqrt(_minimum);
  double max = MathLib.sqrt(_maximum);
  m._isExact = false;
  m._minimum = (min < 0) ? min * INCREMENT : min * DECREMENT;
  m._maximum = (max < 0) ? max * DECREMENT : max * INCREMENT;
  return m;
}
origin: com.github.mrstampy/esp

/**
 * Returns the root mean square value of the given inputs over the given
 * range.
 * 
 * @param lowerFreqHz
 *          >= 1
 * @param upperFreqHz
 *          < {@link #getUpperMeasurableFrequency()}
 * @param fftd
 *          powers
 * 
 * @return the rms value
 */
public double rms(int lowerFreqHz, int upperFreqHz, double... fftd) {
  assert fftd != null && fftd.length > 0;
  assert lowerFreqHz >= 1 && lowerFreqHz < upperFreqHz && upperFreqHz < getUpperMeasurableFrequency();
  int divisor = fftd.length;
  double sum = 0;
  for (int i = lowerFreqHz; i <= upperFreqHz; i++) {
    sum += MathLib.pow(fftd[i], 2);
  }
  return MathLib.sqrt(new BigDecimal(sum).divide(new BigDecimal(divisor), 10, RoundingMode.HALF_UP).doubleValue());
}
origin: org.jscience/jscience

/**
 * Returns one of the two square root of this complex number.
 *
 * @return <code>sqrt(this)</code>.
 */
public Complex sqrt() {
  Complex c = FACTORY.object();
  double m = MathLib.sqrt(this.magnitude());
  double a = this.argument() / 2.0;
  c._real = m * MathLib.cos(a);
  c._imaginary = m * MathLib.sin(a);
  return c;
}
javolution.langMathLibsqrt

Javadoc

Returns the positive square root of the specified value.

Popular methods of MathLib

  • min
    Returns the smaller of two long values.
  • abs
    Returns the absolute value of the specified long argument.
  • bitLength
    Returns the number of bits in the minimal two's-complement representation of the specified long, exc
  • exp
    Returns #E raised to the specified power.
  • floor
    Returns the largest (closest to positive infinity)double value that is not greater than the argument
  • log
    Returns the natural logarithm (base #E) of the specified value.
  • max
    Returns the greater of two long values.
  • pow
    Returns the value of the first argument raised to the power of the second argument.
  • round
    Returns the closest int to the specified argument.
  • toDoublePow10
    Returns the closest double representation of the specified long number multiplied by a power of ten.
  • toDoublePow2
    Returns the closest double representation of the specified long number multiplied by a power of two.
  • toLongPow10
    Returns the closest long representation of the specified double number multiplied by a power of ten.
  • toDoublePow2,
  • toLongPow10,
  • _atan,
  • _ieee754_exp,
  • _ieee754_log,
  • asin,
  • atan,
  • digitLength,
  • floorLog10

Popular in Java

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Table (org.hibernate.mapping)
    A relational table
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now