public void fillKeplerElements(OsculatoryElements[] _el) {
		int body;
		int i;
		double s[] = new double[3];
		double p[] = new double[3];
		double r2[] = new double[3];
		double v2[] = new double[3];
		double rr[] = new double[3];
		double vv[] = new double[3];
		double b1[] = new double[3];
		double b2[] = new double[3];

		double e, costh, sinth, a, c, h, r;

		if (getCentralBody() < 0) {
			getPositionCOM(p);
			getSpeedCOM(s);
		} else {
		}

		for (body = 0; body < _el.length; body++) {
			double axeFactor = _el[body].reducedMass;
			if (getCentralBody() >= 0) {
				for (i = 0; i < 3; i++) {
					p[i] = (getPosition(getCentralBody(), i) - getPosition(
							body, i))
							* axeFactor + getPosition(body, i);
					s[i] = (getSpeed(getCentralBody(), i) - getSpeed(body, i))
							* axeFactor + getSpeed(body, i);
				}
			}
			for (i = 0; i < 3; i++) {
				r2[i] = getPosition(body, i);
				v2[i] = getSpeed(body, i);

				rr[i] = (r2[i] - p[i]) / (axeFactor);// r2[i]-r1[i];
				vv[i] = (v2[i] - s[i]) / (axeFactor); // v2[i]-v1[i];

				b1[i] = rr[i];
			}

			Funcions.Vect(rr, vv, _el[body].angularMomVec);
			c = _el[body].angularMom = Math.sqrt(Funcions.scal(
					_el[body].angularMomVec, _el[body].angularMomVec));
			r = Math.sqrt(Funcions.scal(rr, rr));

			Funcions.normaliser(b1);
			Funcions.Vect(_el[body].angularMomVec, b1, b2);
			Funcions.normaliser(b2);
			double mu = _el[body].mu;
			h = 0.5D * Funcions.scal(vv, vv) - mu / r;
			e = Math.sqrt(1D + 2D * h * c * c / (mu * mu));

			double aux;
			aux = (mu * (1D - e * e));

			if (Math.abs(aux) > this.paramTOL) {
				a = c * c / aux;

				aux = r * e;
				if (Math.abs(aux) > this.paramTOL) {
					costh = ((a * (1D - e * e) - r) / aux);
					sinth = Math.sqrt(1D - costh * costh);
					if (Funcions.scal(rr, vv) < 0D) {
						sinth = -sinth;
					}
				} else {
					costh = 1D;
					sinth = 0D;
				}
				_el[body].angularMom = (axeFactor) * (axeFactor) * c;
				_el[body].excentricity = e;
				_el[body].major = (axeFactor) * a;
				_el[body].minor = (axeFactor) * a * Math.sqrt(1D - e * e);

				for (i = 0; i < 3; i++) {
					_el[body].angularMomVec[i] = (axeFactor) * (axeFactor)
							* _el[body].angularMomVec[i];
					_el[body].majorVec[i] = (axeFactor) * a
							* (costh * b1[i] - sinth * b2[i]);
					_el[body].center[i] = p[i] - e * _el[body].majorVec[i];
					_el[body].minorVec[i] = _el[body].minor
							* (sinth * b1[i] + costh * b2[i]);
				}
			}
		}
		this.lastKeplerCalcTime = getTime();
	}