本文整理汇总了Java中org.orekit.time.AbsoluteDate.durationFrom方法的典型用法代码示例。如果您正苦于以下问题:Java AbsoluteDate.durationFrom方法的具体用法?Java AbsoluteDate.durationFrom怎么用?Java AbsoluteDate.durationFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.orekit.time.AbsoluteDate
的用法示例。
在下文中一共展示了AbsoluteDate.durationFrom方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: interpolate
import org.orekit.time.AbsoluteDate; //导入方法依赖的package包/类
/** Interpolate transform.
* @param date date of the transform
* @param list transforms list to interpolate from
* @return interpolated transform
* @exception RuggedException if frames cannot be computed at date
*/
private Transform interpolate(final AbsoluteDate date, final List<Transform> list)
throws RuggedException {
// check date range
if (!isInRange(date)) {
throw new RuggedException(RuggedMessages.OUT_OF_TIME_RANGE, date, minDate, maxDate);
}
final double s = date.durationFrom(list.get(0).getDate()) / tStep;
final int index = FastMath.max(0, FastMath.min(list.size() - 1, (int) FastMath.rint(s)));
DumpManager.dumpTransform(this, index, bodyToInertial.get(index), scToInertial.get(index));
final Transform close = list.get(index);
return close.shiftedBy(date.durationFrom(close.getDate()));
}
示例2: getLine
import org.orekit.time.AbsoluteDate; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public double getLine(final AbsoluteDate date) {
if (datation.size() < 2) {
return datation.get(0).getFirst();
}
// find entries bracketing the date
int sup = 0;
while (sup < datation.size() - 1) {
if (datation.get(sup).getSecond().compareTo(date) >= 0) {
break;
}
++sup;
}
final int inf = (sup == 0) ? sup++ : (sup - 1);
final double lInf = datation.get(inf).getFirst();
final AbsoluteDate dInf = datation.get(inf).getSecond();
final double lSup = datation.get(sup).getFirst();
final AbsoluteDate dSup = datation.get(sup).getSecond();
final double alpha = date.durationFrom(dInf) / dSup.durationFrom(dInf);
return alpha * lSup + (1 - alpha) * lInf;
}
示例3: transformLOS
import org.orekit.time.AbsoluteDate; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public FieldVector3D<DerivativeStructure> transformLOS(final int i, final FieldVector3D<DerivativeStructure> los,
final AbsoluteDate date) {
// evaluate polynomial, with all its partial derivatives
final double t = date.durationFrom(referenceDate);
DerivativeStructure alpha = axisDS.getX().getField().getZero();
for (int k = angleDS.length - 1; k >= 0; --k) {
alpha = alpha.multiply(t).add(angleDS[k]);
}
return new FieldRotation<DerivativeStructure>(axisDS, alpha).applyTo(los);
}
示例4: RoughVisibilityEstimator
import org.orekit.time.AbsoluteDate; //导入方法依赖的package包/类
/**
* Simple constructor.
* @param ellipsoid ground ellipsoid
* @param frame frame in which position and velocity are defined (may be inertial or body frame)
* @param positionsVelocities satellite position and velocity (m and m/s in specified frame)
* @exception OrekitException if position-velocity cannot be converted to body frame
*/
public RoughVisibilityEstimator(final OneAxisEllipsoid ellipsoid, final Frame frame,
final List<TimeStampedPVCoordinates> positionsVelocities)
throws OrekitException {
this.ellipsoid = ellipsoid;
// project spacecraft position-velocity to ground
final Frame bodyFrame = ellipsoid.getBodyFrame();
final int n = positionsVelocities.size();
this.pvGround = new ArrayList<TimeStampedPVCoordinates>(n);
for (final TimeStampedPVCoordinates pv : positionsVelocities) {
final Transform t = frame.getTransformTo(bodyFrame, pv.getDate());
pvGround.add(ellipsoid.projectToGround(t.transformPVCoordinates(pv), bodyFrame));
}
// initialize first search at mid point
this.last = n / 2;
// estimate mean angular rate with respect to indices
double alpha = 0;
for (int i = 0; i < n - 1; ++i) {
// angular motion between points i and i+1
alpha += Vector3D.angle(pvGround.get(i).getPosition(),
pvGround.get(i + 1).getPosition());
}
this.rateVSIndices = alpha / n;
// estimate mean angular rate with respect to time
final AbsoluteDate firstDate = pvGround.get(0).getDate();
final AbsoluteDate lastDate = pvGround.get(pvGround.size() - 1).getDate();
this.rateVSTime = alpha / lastDate.durationFrom(firstDate);
}
示例5: getLOS
import org.orekit.time.AbsoluteDate; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public Vector3D getLOS(final int index, final AbsoluteDate date) {
final List<Pair<AbsoluteDate, Vector3D>> list = losMap.get(index);
if (list == null) {
throw RuggedException.createInternalError(null);
}
if (list.size() < 2) {
return list.get(0).getSecond();
}
// find entries bracketing the the date
int sup = 0;
while (sup < list.size() - 1) {
if (list.get(sup).getFirst().compareTo(date) >= 0) {
break;
}
++sup;
}
final int inf = (sup == 0) ? sup++ : (sup - 1);
final AbsoluteDate dInf = list.get(inf).getFirst();
final Vector3D lInf = list.get(inf).getSecond();
final AbsoluteDate dSup = list.get(sup).getFirst();
final Vector3D lSup = list.get(sup).getSecond();
final double alpha = date.durationFrom(dInf) / dSup.durationFrom(dInf);
return new Vector3D(alpha, lSup, 1 - alpha, lInf);
}
示例6: getLine
import org.orekit.time.AbsoluteDate; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public double getLine(final AbsoluteDate date) {
return referenceLine + rate * date.durationFrom(referenceDate);
}
示例7: isInRange
import org.orekit.time.AbsoluteDate; //导入方法依赖的package包/类
/** Check if a date is in the supported range.
* @param date date to check
* @return true if date is in the supported range
*/
public boolean isInRange(final AbsoluteDate date) {
return (minDate.durationFrom(date) <= overshootTolerance) &&
(date.durationFrom(maxDate) <= overshootTolerance);
}