Example usage for org.apache.commons.math3.geometry.euclidean.threed Vector3D getAlpha

List of usage examples for org.apache.commons.math3.geometry.euclidean.threed Vector3D getAlpha

Introduction

In this page you can find the example usage for org.apache.commons.math3.geometry.euclidean.threed Vector3D getAlpha.

Prototype

public double getAlpha() 

Source Link

Document

Get the azimuth of the vector.

Usage

From source file:fr.cs.examples.bodies.Phasing.java

/** Compute the mean solar time.
 * @param orbit current orbit//  w  ww  . j  av a2 s .co  m
 * @return mean solar time
 * @exception OrekitException if state cannot be converted
 */
private double meanSolarTime(final Orbit orbit) throws OrekitException {

    // compute angle between Sun and spacecraft in the equatorial plane
    final Vector3D position = orbit.getPVCoordinates().getPosition();
    final double time = orbit.getDate().getComponents(TimeScalesFactory.getUTC()).getTime().getSecondsInDay();
    final double theta = gmst.value(orbit.getDate()).getValue();
    final double sunAlpha = theta + FastMath.PI * (1 - time / (Constants.JULIAN_DAY * 0.5));
    final double dAlpha = MathUtils.normalizeAngle(position.getAlpha() - sunAlpha, 0);

    // convert the angle to solar time
    return 12.0 * (1.0 + dAlpha / FastMath.PI);

}

From source file:org.orekit.attitudes.YawSteeringTest.java

@Test
public void testSunAligned() throws OrekitException {

    //  Attitude laws
    // **************
    // Target pointing attitude provider over satellite nadir at date, without yaw compensation
    NadirPointing nadirLaw = new NadirPointing(circOrbit.getFrame(), earthShape);

    // Target pointing attitude provider with yaw compensation
    PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
    YawSteering yawCompensLaw = new YawSteering(circOrbit.getFrame(), nadirLaw, sun, Vector3D.MINUS_I);

    // Get sun direction in satellite frame
    Rotation rotYaw = yawCompensLaw.getAttitude(circOrbit, date, circOrbit.getFrame()).getRotation();
    Vector3D sunEME2000 = sun.getPVCoordinates(date, FramesFactory.getEME2000()).getPosition();
    Vector3D sunSat = rotYaw.applyTo(sunEME2000);

    // Check sun is in (X,Z) plane
    Assert.assertEquals(0.0, FastMath.sin(sunSat.getAlpha()), 1.0e-7);

}

From source file:org.orekit.models.earth.tessellation.Tile.java

/** Get an interpolated point inside the tile.
 * <p>/*  w  w w  . j a v  a2 s.c  om*/
 * The interpolated point is based on bilinear interpolations
 * along the body surface assumed to be <em>spherical</em>,
 * and along the vertical axis.
 * </p>
 * <p>
 * The interpolation parameters are chosen such that
 * (u = 0, v = 0) maps to vertex v0, (u = 1, v = 0) maps
 * to vertex v1, (u = 1, v = 1) maps to vertex v2 and
 * (u = 0, v = 1) maps to vertex v3.
 * </p>
 * @param u first interpolation parameter (should be between
 * 0 and 1 to remain inside the tile)
 * @param v second interpolation parameter (should be between
 * 0 and 1 to remain inside the tile)
 * @return interpolated point
 */
public GeodeticPoint getInterpolatedPoint(final double u, final double v) {

    // bilinear interpolation along a spherical shape
    final Vector3D pu0 = interpolate(v0.getZenith(), v1.getZenith(), u);
    final Vector3D pu1 = interpolate(v3.getZenith(), v2.getZenith(), u);
    final Vector3D puv = interpolate(pu0, pu1, v);

    // bilinear interpolation of altitude
    final double hu0 = v1.getAltitude() * u + v0.getAltitude() * (1 - u);
    final double hu1 = v2.getAltitude() * u + v3.getAltitude() * (1 - u);
    final double huv = hu1 * v + hu0 * (1 - v);

    // create interpolated point
    return new GeodeticPoint(puv.getDelta(), puv.getAlpha(), huv);

}

From source file:org.orekit.utils.SecularAndHarmonicTest.java

private double meanSolarTime(final Orbit orbit) throws OrekitException {

    // compute angle between Sun and spacecraft in the equatorial plane
    final Vector3D position = orbit.getPVCoordinates().getPosition();
    final double time = orbit.getDate().getComponents(TimeScalesFactory.getUTC()).getTime().getSecondsInDay();
    final double theta = gmst.value(orbit.getDate()).getValue();
    final double sunAlpha = theta + FastMath.PI * (1 - time / (Constants.JULIAN_DAY * 0.5));
    final double dAlpha = MathUtils.normalizeAngle(position.getAlpha() - sunAlpha, 0);

    // convert the angle to solar time
    return 12.0 * (1.0 + dAlpha / FastMath.PI);

}