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;
}
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;
}
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);
}
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;
}
}
}
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 });
}
Aggregations