Search in sources :

Example 26 with Vector3d

use of gaiasky.util.math.Vector3d in project gaiasky by langurmonkey.

the class GaiaCoordinates method getEquatorialCartesianCoordinates.

@Override
public Vector3b getEquatorialCartesianCoordinates(Instant date, Vector3b out) {
    boolean inRange = data.loadPoint(out, date);
    // Rotate by solar longitude, and convert to equatorial.
    Vector3d outd = new Vector3d();
    out.put(outd);
    outd.rotate(AstroUtils.getSunLongitude(date) + 180, 0, 1, 0).mul(Coordinates.eclToEq()).scl(scaling);
    return inRange ? out.set(outd) : null;
}
Also used : Vector3d(gaiasky.util.math.Vector3d)

Example 27 with Vector3d

use of gaiasky.util.math.Vector3d in project gaiasky by langurmonkey.

the class HeliotropicOrbitCoordinates method getEquatorialCartesianCoordinates.

@Override
public Vector3b getEquatorialCartesianCoordinates(Instant date, Vector3b out) {
    boolean inRange = data.loadPoint(out, date);
    // Rotate by solar longitude, and convert to equatorial.
    Vector3d outd = new Vector3d();
    out.put(outd);
    outd.rotate(AstroUtils.getSunLongitude(date) + 180, 0, 1, 0).mul(Coordinates.eclToEq()).scl(scaling);
    return inRange ? out.set(outd) : null;
}
Also used : Vector3d(gaiasky.util.math.Vector3d)

Example 28 with Vector3d

use of gaiasky.util.math.Vector3d in project gaiasky by langurmonkey.

the class StaticCoordinates method setEquatorial.

/**
 * Sets equatorial coordinates as a vector of [ra, de, distance]
 *
 * @param equatorial Vector with [ra, dec, distance] with angles in degrees and distance in parsecs
 */
public void setEquatorial(double[] equatorial) {
    double ra = MathUtilsd.degRad * equatorial[0];
    double dec = MathUtilsd.degRad * equatorial[1];
    double dist = Constants.PC_TO_U * equatorial[2];
    this.position = new Vector3d();
    Coordinates.sphericalToCartesian(ra, dec, dist, this.position);
}
Also used : Vector3d(gaiasky.util.math.Vector3d)

Example 29 with Vector3d

use of gaiasky.util.math.Vector3d in project gaiasky by langurmonkey.

the class FadeNode method update.

public void update(ITimeFrameProvider time, final Vector3b parentTransform, ICamera camera, float opacity) {
    this.opacity = opacity;
    translation.set(parentTransform);
    Vector3d aux = D31.get();
    if (this.position == null) {
        this.currentDistance = aux.set(this.pos).sub(camera.getPos()).len() * camera.getFovFactor();
    } else {
        this.currentDistance = this.position.distToCamera;
    }
    // Update with translation/rotation/etc
    updateLocal(time, camera);
    if (children != null) {
        if (initialUpdate || GaiaSky.instance.isOn(ct)) {
            for (int i = 0; i < children.size; i++) {
                SceneGraphNode child = children.get(i);
                child.update(time, translation, camera, this.opacity);
            }
            initialUpdate = false;
        }
    }
}
Also used : Vector3d(gaiasky.util.math.Vector3d)

Example 30 with Vector3d

use of gaiasky.util.math.Vector3d in project gaiasky by langurmonkey.

the class ModifiedScanningLaw method setTypicalHighDensityArea.

/**
 * Defines a typical high-density area for the MSL (as of April 2013).
 * <p>
 * The area consists of two circles of 0.5 deg radius each, centred on BW
 * (at Galactic coordinates lon = 1.04 deg, lat = -3.88 deg) and Sgr I (at
 * lon = 1.44 deg, lat = -2.64 deg). See presentation by LL at GST-41.
 */
public void setTypicalHighDensityArea() {
    ComplexArea ca = new ComplexArea();
    ca.setName("BW + Sgr I");
    // circle 1:
    Vector3d dir1 = new Vector3d();
    double radius1 = 0.50 * DEG;
    Coordinates.sphericalToCartesian(1.04 * DEG, -3.88 * DEG, radius1, dir1);
    // circle 2:
    Vector3d dir2 = new Vector3d();
    double radius2 = 0.50 * DEG;
    Coordinates.sphericalToCartesian(1.44 * DEG, -2.64 * DEG, radius2, dir2);
    Matrix4d galEq = Coordinates.eqToGal();
    dir1.mul(galEq);
    dir2.mul(galEq);
    ca.add(new CircleArea(new Place(dir1), radius1));
    ca.add(new CircleArea(new Place(dir2), radius2));
    this.setHighDensityAreas(new ComplexArea[] { ca });
}
Also used : Matrix4d(gaiasky.util.math.Matrix4d) Vector3d(gaiasky.util.math.Vector3d)

Aggregations

Vector3d (gaiasky.util.math.Vector3d)120 IParticleRecord (gaiasky.scenegraph.particle.IParticleRecord)11 Array (com.badlogic.gdx.utils.Array)10 Vector3 (com.badlogic.gdx.math.Vector3)8 Vector3b (gaiasky.util.math.Vector3b)8 PointCloudData (gaiasky.data.util.PointCloudData)7 Keyframe (gaiasky.desktop.util.camera.Keyframe)5 Matrix4d (gaiasky.util.math.Matrix4d)5 Quaterniond (gaiasky.util.math.Quaterniond)5 ArrayList (java.util.ArrayList)5 BufferedReader (java.io.BufferedReader)4 InputStreamReader (java.io.InputStreamReader)4 PerspectiveCamera (com.badlogic.gdx.graphics.PerspectiveCamera)3 ChangeEvent (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent)3 Vector2d (gaiasky.util.math.Vector2d)3 Path (java.nio.file.Path)3 Date (java.util.Date)3 Matrix4 (com.badlogic.gdx.math.Matrix4)2 OrbitComponent (gaiasky.scenegraph.component.OrbitComponent)2 ParticleRecord (gaiasky.scenegraph.particle.ParticleRecord)2