use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.
the class AlignmentDetector method g.
/**
* Compute the value of the switching function.
* This function measures the difference between the alignment angle and the
* angle between the satellite position and the body position projection in the
* orbital plane.
* @param s the current state information: date, kinematics, attitude
* @return value of the switching function
* @exception OrekitException if some specific error occurs
*/
public double g(final SpacecraftState s) throws OrekitException {
final PVCoordinates pv = s.getPVCoordinates();
final Vector3D a = pv.getPosition().normalize();
final Vector3D b = Vector3D.crossProduct(pv.getMomentum(), a).normalize();
final Vector3D x = new Vector3D(cosAlignAngle, a, sinAlignAngle, b);
final Vector3D y = new Vector3D(sinAlignAngle, a, -cosAlignAngle, b);
final Vector3D pb = body.getPVCoordinates(s.getDate(), s.getFrame()).getPosition();
final double beta = FastMath.atan2(Vector3D.dotProduct(pb, y), Vector3D.dotProduct(pb, x));
final double betm = -FastMath.PI - beta;
final double betp = FastMath.PI - beta;
if (beta < betm) {
return betm;
} else if (beta < betp) {
return beta;
} else {
return betp;
}
}
use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.
the class AngularSeparationDetector method g.
/**
* Compute the value of the switching function.
* <p>
* This function measures the angular separation between beacon and spacecraft
* as seen from the observer minus the proximity angle. It therefore triggers
* decreasing events when the spacecraft enters the proximity zone and increasing
* events when it leaves the proximity zone.
* </p>
* <p>
* No shadowing effect is taken into account, so this method is computed and
* may trigger events even when the spacecraft is below horizon for an observer
* which is a ground station. If such effects must be taken into account the
* detector must be associated with a {@link EventEnablingPredicateFilter predicate
* filter} where the {@link EnablingPredicate predicate function} is based on elevation.
* </p>
* @param s the current state information: date, kinematics, attitude
* @return value of the switching function
* @exception OrekitException if some specific error occurs
*/
public double g(final SpacecraftState s) throws OrekitException {
final PVCoordinates sPV = s.getPVCoordinates();
final PVCoordinates bPV = beacon.getPVCoordinates(s.getDate(), s.getFrame());
final PVCoordinates oPV = observer.getPVCoordinates(s.getDate(), s.getFrame());
final double separation = Vector3D.angle(sPV.getPosition().subtract(oPV.getPosition()), bPV.getPosition().subtract(oPV.getPosition()));
return separation - proximityAngle;
}
use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.
the class FieldCartesianOrbit method toOrbit.
@Override
public CartesianOrbit toOrbit() {
final PVCoordinates pv = getPVCoordinates().toPVCoordinates();
final AbsoluteDate date = getPVCoordinates().getDate().toAbsoluteDate();
if (hasDerivatives()) {
// getPVCoordinates includes accelerations that will be interpreted as derivatives
return new CartesianOrbit(pv, getFrame(), date, getMu());
} else {
// we have derivatives when in fact we don't have them
return new CartesianOrbit(new PVCoordinates(pv.getPosition(), pv.getVelocity()), getFrame(), date, getMu());
}
}
use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.
the class TopocentricFrame method getRangeRate.
/**
* Get the range rate of a point with regards to the topocentric frame center point.
* @param extPV point/velocity for which range rate shall be computed
* @param frame frame in which the point is defined
* @param date computation date
* @return range rate of the point (positive if point departs from frame)
* @exception OrekitException if frames transformations cannot be computed
*/
public double getRangeRate(final PVCoordinates extPV, final Frame frame, final AbsoluteDate date) throws OrekitException {
// Transform given point from given frame to topocentric frame
final Transform t = frame.getTransformTo(this, date);
final PVCoordinates extPVTopo = t.transformPVCoordinates(extPV);
// Compute range rate (doppler) : relative rate along the line of sight
return Vector3D.dotProduct(extPVTopo.getPosition(), extPVTopo.getVelocity()) / extPVTopo.getPosition().getNorm();
}
use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.
the class L1TransformProvider method getTransform.
/**
* {@inheritDoc}
*/
@Override
public Transform getTransform(final AbsoluteDate date) throws OrekitException {
final PVCoordinates pv21 = secondaryBody.getPVCoordinates(date, frame);
final Vector3D translation = getL1(pv21.getPosition()).negate();
final Rotation rotation = new Rotation(pv21.getPosition(), pv21.getVelocity(), Vector3D.PLUS_I, Vector3D.PLUS_J);
return new Transform(date, new Transform(date, translation), new Transform(date, rotation));
}
Aggregations