public double distanceFromInitial() { final double dx = initialX - currX; final double dy = initialY - currY; return MathUtils.sqrt(dx * dx + dy * dy); }
@Override public double getRadius() { return MathUtils.sqrt(_xExtent * _xExtent + _yExtent * _yExtent + _zExtent * _zExtent); }
public double distanceTo(final TouchHistory other) { final double dx = other.currX - currX; final double dy = other.currY - currY; return MathUtils.sqrt(dx * dx + dy * dy); }
protected void normalize(final int i, final float[] nrm) { final float length = (float) MathUtils .sqrt(nrm[i] * nrm[i] + nrm[i + 1] * nrm[i + 1] + nrm[i + 2] * nrm[i + 2]); nrm[i] /= length; nrm[i + 1] /= length; nrm[i + 2] /= length; }
/** * @param x * @param y * @param z * @return the distance between the point described by this vector and the given x, y, z point. */ @Override public double distance(final double x, final double y, final double z) { return MathUtils.sqrt(distanceSquared(x, y, z)); }
/** * @param x * @param y * @param z * @return the distance between the point described by this vector and the given x, y, z point. */ @Override public double distance(final double x, final double y, final double z) { return MathUtils.sqrt(distanceSquared(x, y, z)); }
/** * @return the magnitude of this vector, or the distance between the origin (0, 0) and the point described by (x, * y). Basically sqrt(x^2 + y^2) */ @Override public double length() { return MathUtils.sqrt(lengthSquared()); }
/** * @return the magnitude or distance between the origin (0, 0, 0, 0) and the point described by this vector (x, y, * z, w). Effectively the square root of the value returned by {@link #lengthSquared()}. */ @Override public double length() { return MathUtils.sqrt(lengthSquared()); }
/** * @return the magnitude of this vector, or the distance between the origin (0, 0) and the point described by (x, * y). Basically sqrt(x^2 + y^2) */ @Override public double length() { return MathUtils.sqrt(lengthSquared()); }
/** * @param x * @param y * @return the distance between the point described by this vector and the given x, y point. */ @Override public double distance(final double x, final double y) { return MathUtils.sqrt(distanceSquared(x, y)); }
/** * @return the magnitude or distance between the origin (0, 0, 0) and the point described by this vector (x, y, z). * Effectively the square root of the value returned by {@link #lengthSquared()}. */ @Override public double length() { return MathUtils.sqrt(lengthSquared()); }
/** * @param destination * @return the distance between the point described by this vector and the given destination point. * @throws NullPointerException * if destination is null. */ @Override public double distance(final ReadOnlyVector3 destination) { return MathUtils.sqrt(distanceSquared(destination)); }
/** * @param x * @param y * @return the distance between the point described by this vector and the given x, y point. */ @Override public double distance(final double x, final double y) { return MathUtils.sqrt(distanceSquared(x, y)); }
/** * @param x * @param y * @param z * @param w * @return the distance between the point described by this vector and the given x, y, z, w point. */ @Override public double distance(final double x, final double y, final double z, final double w) { return MathUtils.sqrt(distanceSquared(x, y, z, w)); }
public double eval(final double x, final double y, final double z) { final double dx = x * _frequency; final double dz = z * _frequency; // get the radius to our point -- see the equation of a circle double radius = MathUtils.sqrt(dx * dx + dz * dz); // get fractional part radius = radius - MathUtils.floor(radius); // now get the distance to the closest integer, radius is now [0, .5] radius = Math.min(radius, 1 - radius); // return a value between -1 and 1, where 1 means the radius length was on an integer value and -1 means it was // halfway between two integers. return 1.0 - radius * 4; // [-1, 1] }
/** * @param x * @param y * @param z * @param w * @return the distance between the point described by this vector and the given x, y, z, w point. */ @Override public double distance(final double x, final double y, final double z, final double w) { return MathUtils.sqrt(distanceSquared(x, y, z, w)); }
/** * @param destination * @return the distance between the point described by this vector and the given destination point. * @throws NullPointerException * if destination is null. */ @Override public double distance(final ReadOnlyVector4 destination) { return MathUtils.sqrt(distanceSquared(destination)); }
/** * @return the magnitude of this quaternion. basically sqrt({@link #magnitude()}) */ @Override public double magnitude() { final double magnitudeSQ = magnitudeSquared(); if (magnitudeSQ == 1.0) { return 1.0; } return MathUtils.sqrt(magnitudeSQ); }
/** * @return the magnitude or distance between the origin (0, 0, 0) and the point described by this vector (x, y, z). * Effectively the square root of the value returned by {@link #lengthSquared()}. */ @Override public double length() { return MathUtils.sqrt(lengthSquared()); }
/** * @param destination * @return the distance between the point described by this vector and the given destination point. * @throws NullPointerException * if destination is null. */ @Override public double distance(final ReadOnlyVector2 destination) { return MathUtils.sqrt(distanceSquared(destination)); }