Calculates the RMSD value for superposition of y onto x. This requires
the coordinates to be precentered.

@param x
3d points of reference coordinate set
@param y
3d points of coordinate set for superposition
2706
private void calcRmsd(Point3d[] x, Point3d[] y) {
		if (centered) {
			innerProduct(y, x);
		} else {
			// translate to origin
			xref = CalcPoint.clonePoint3dArray(x);
			xtrans = CalcPoint.centroid(xref);
			logger.debug("x centroid: " + xtrans);
			xtrans.negate();
			CalcPoint.translate(new Vector3d(xtrans), xref);

			yref = CalcPoint.clonePoint3dArray(y);
			ytrans = CalcPoint.centroid(yref);
			logger.debug("y centroid: " + ytrans);
			ytrans.negate();
			CalcPoint.translate(new Vector3d(ytrans), yref);
			innerProduct(yref, xref);
		}
		calcRmsd(wsum);
	}
135948
@Override
	public void setFirstAxis(Vector3D axis) {
		setFirstAxis(axis.getX(), axis.getY(), axis.getZ(), getFirstAxisExtent());
	}
5393
public static double uncenteredCorrelation(NumberVector x, NumberVector y) {
    final int xdim = x.getDimensionality(), ydim = y.getDimensionality();
    if(xdim != ydim) {
      throw new IllegalArgumentException("Invalid arguments: number vectors differ in dimensionality.");
    }
    double sumXX = 0., sumYY = 0., sumXY = 0.;
    for(int i = 0; i < xdim; i++) {
      final double xv = x.doubleValue(i), yv = y.doubleValue(i);
      sumXX += xv * xv;
      sumYY += yv * yv;
      sumXY += xv * yv;
    }
    // One or both series were constant:
    if(!(sumXX > 0. && sumYY > 0.)) {
      return (sumXX == sumYY) ? 1. : 0.;
    }
    return sumXY / FastMath.sqrt(sumXX * sumYY);
  }
1296856
public void setDirection (float x, float y, float z)
    {
        if (_dx != x || _dy != y || _dz != z) {
            AL10.alSource3f(_id, AL10.AL_DIRECTION, _dx = x, _dy = y, _dz = z);
        }
    }
1191885
public static double rmsd(Atom[] x, Atom[] y) {
		return CalcPoint.rmsd(atomsToPoints(x), atomsToPoints(y));
	}
1303977
public void setDirection (float x, float y, float z)
    {
        if (_source != null) {
            _source.setDirection(x, y, z);
        }
        _dx = x;
        _dy = y;
        _dz = z;
    }
983656
public final void setRect(double xMin, double xMax, double yMin, double yMax)
    {
        this.xMin = xMin;
        this.xMax = xMax;
        this.yMin = yMin;
        this.yMax = yMax;
    }
142732
public void setPosition(Coordinate position) {
		if (getOriginalLocation() != null) {
			Bbox oldBounds = (Bbox) getOriginalLocation();
			Bbox newBounds = (Bbox) oldBounds.clone();
			newBounds.setCenterPoint(position);
			setOriginalLocation(newBounds);
		} else {
			setOriginalLocation(new Bbox(position.getX(), position.getY(), 0, 0));
		}
	}
360376
@Pure
	public static GeodesicPosition L3_WSG84(double x, double y) {
		final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
				LAMBERT_3_N,
				LAMBERT_3_C,
				LAMBERT_3_XS,
				LAMBERT_3_YS);
		return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
	}
116386
public void setSliderPosition(float x, float y) {

        if (x > 255) {
            x = 255;
        }
        if (x < 0) {
            x = 0;
        }
        if (y > 255) {
            y = 255;
        }
        if (y < 0) {
            y = 0;
        }
        x -= 7;
        y -= 7;
        m_slider.getElement().getStyle().setLeft(x, Unit.PX);
        m_slider.getElement().getStyle().setTop(y, Unit.PX);
    }
273264
@Override
    public void setUserLedPosition(final double X, final double Y) {
        userLedPosition.setLocation(X, Y);
        repaint(getInnerBounds());
    }
230112
public Point unrotateAndScalePoint(int x, int y, Point reuse) {
		return applyMatrixToPoint(x, y, reuse, mUnrotateAndScaleMatrix, mOrientation != 0);
	}
639884
public double distanceFromCenter(final float x, final float y) {
        return Math.sqrt(Math.pow(x - this.x, 2) + Math.pow(y - this.y, 2));
    }
1118276
@Pure
	public static Point2d L3_L4(double x, double y) {
		final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
				LAMBERT_3_N,
				LAMBERT_3_C,
				LAMBERT_3_XS,
				LAMBERT_3_YS);
		return NTFLambdaPhi_NTFLambert(
				ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
				LAMBERT_4_N,
				LAMBERT_4_C,
				LAMBERT_4_XS,
				LAMBERT_4_YS);
	}
1244813
public static double rmsdMin(Point3d[] x, Point3d[] y) {

		if (x.length != y.length) {
			throw new IllegalArgumentException(
					"Point arrays are not of the same length.");
		}

		double sum = 0.0;
		for (int i = 0; i < x.length; i++) {
			double minDist = Double.MAX_VALUE;
			for (int j = 0; j < y.length; j++) {
				minDist = Math.min(minDist, x[i].distanceSquared(y[j]));
			}
			sum += minDist;
		}
		return Math.sqrt(sum / x.length);
	}
1282239
static double usingXArrAndYStride(
      final double[] xArr, final double yStride, final double x) {
    final int xArrLen = xArr.length;
    final int xArrLenM1 = xArrLen - 1;

    final int offset;
    assert ((xArrLen >= 4) && (x >= xArr[0]) && (x <= xArr[xArrLenM1]));

    if (x ==  xArr[xArrLenM1]) { /* corner case */
      return (yStride * (xArrLenM1));
    }

    offset = findStraddle(xArr, x); //uses recursion
    final int xArrLenM2 = xArrLen - 2;
    assert ((offset >= 0) && (offset <= (xArrLenM2)));

    if (offset == 0) { /* corner case */
      return (interpolateUsingXArrAndYStride(xArr, yStride, (offset - 0), x));
    }
    else if (offset == xArrLenM2) { /* corner case */
      return (interpolateUsingXArrAndYStride(xArr, yStride, (offset - 2), x));
    }
    /* main case */
    return (interpolateUsingXArrAndYStride(xArr, yStride, (offset - 1), x));
  }
964353
public void setPosition(double x, double y, double z) {
		this.x = x;
		this.y = y;
		this.z = z;
	}