当前位置: 首页>>代码示例>>Java>>正文


Java RotationOrder类代码示例

本文整理汇总了Java中org.apache.commons.math3.geometry.euclidean.threed.RotationOrder的典型用法代码示例。如果您正苦于以下问题:Java RotationOrder类的具体用法?Java RotationOrder怎么用?Java RotationOrder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RotationOrder类属于org.apache.commons.math3.geometry.euclidean.threed包,在下文中一共展示了RotationOrder类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: distance

import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder; //导入依赖的package包/类
public static Vector3D distance(GeoPoint p, GeoPoint q) {

		GeodeticCalculator calc = new GeodeticCalculator();

		calc.setStartingGeographicPoint(p.lon, p.lat);
		calc.setDestinationGeographicPoint(q.lon, q.lat);
		double dist = calc.getOrthodromicDistance();
		double alpha = calc.getAzimuth(); // The azimuth, in decimal degrees
											// from -180° to +180°.

		Rotation r = new Rotation(RotationOrder.ZXZ, 0, 0,
				-FastMath.toRadians(alpha));
		Vector3D trip = r.applyTo(new Vector3D(0, 1, 0)).scalarMultiply(dist);

		trip = new Vector3D(trip.getX(), trip.getY(), q.ele - p.ele);

		// in meters
		return trip;
	}
 
开发者ID:ianmalcolm,项目名称:DeadReckoning,代码行数:20,代码来源:GeoPoint.java

示例2: testName

import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder; //导入依赖的package包/类
@Test
public void testName() {

  RotationOrder[] orders = {
    RotationOrder.XYZ, RotationOrder.XZY, RotationOrder.YXZ,
    RotationOrder.YZX, RotationOrder.ZXY, RotationOrder.ZYX,
    RotationOrder.XYX, RotationOrder.XZX, RotationOrder.YXY,
    RotationOrder.YZY, RotationOrder.ZXZ, RotationOrder.ZYZ
  };

  for (int i = 0; i < orders.length; ++i) {
    Assert.assertEquals(getFieldName(orders[i]), orders[i].toString());
  }

}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:16,代码来源:RotationOrderTest.java

示例3: getFieldName

import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder; //导入依赖的package包/类
private String getFieldName(RotationOrder order) {
  try {
    Field[] fields = RotationOrder.class.getFields();
    for (int i = 0; i < fields.length; ++i) {
      if (fields[i].get(null) == order) {
        return fields[i].getName();
      }
    }
  } catch (IllegalAccessException iae) {
    // ignored
  }
  return "unknown";
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:14,代码来源:RotationOrderTest.java

示例4: transform

import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder; //导入依赖的package包/类
public static Vector3d transform(KeplerianOrbit keplerianOrbit, Vector3d vector) {
	Rotation r = new Rotation(RotationOrder.ZXZ, keplerianOrbit.getAscendingNode(), keplerianOrbit.getInclination(), keplerianOrbit.getArgumentOfPeriapsis());
	Vector3D v = toVector3D(vector);
	Vector3D rv = r.applyInverseTo(v);
	Vector3d result = new Vector3d(rv.getX(), rv.getY(), rv.getZ());
	return result;
}
 
开发者ID:momega,项目名称:spacesimulator,代码行数:8,代码来源:VectorUtils.java

示例5: Attitude

import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder; //导入依赖的package包/类
public Attitude(double roll, double pitch, double yaw, long _time) {
	// Extrinsic to intrinsic conversion
	// rotation in euler ZXZ style
	super(RotationOrder.ZXZ, yaw, pitch, roll);
	time.setTime(_time);
}
 
开发者ID:ianmalcolm,项目名称:DeadReckoning,代码行数:7,代码来源:Attitude.java

示例6: getRotation

import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder; //导入依赖的package包/类
public Rotation getRotation(KeplerianOrbit keplerianOrbit) {
    return new Rotation(RotationOrder.ZXZ, -keplerianOrbit.getArgumentOfPeriapsis(), -keplerianOrbit.getInclination(), -keplerianOrbit.getAscendingNode());
}
 
开发者ID:momega,项目名称:spacesimulator2,代码行数:4,代码来源:KeplerianUtils.java

示例7: getAcceleration

import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder; //导入依赖的package包/类
public AccelerationResult getAcceleration(Model model, Spacecraft spacecraft, CartesianState currentState, Timestamp timestamp, double dt) {
    Instant instant = instantManager.getInstant(model, spacecraft, timestamp);
    SpacecraftState spacecraftState = instant.getSpacecraftState();

    AccelerationResult result = new AccelerationResult();

    Propulsion propulsion = spacecraft.getPropulsion();
    if (propulsion  == null) {
        result.setSpacecraftState(spacecraftState);
        result.setAcceleration(Vector3D.ZERO);
        return result;
    }

    Maneuver maneuver = maneuverService.findManeuver(spacecraft, timestamp);
    if (maneuver == null) {
        result.setSpacecraftState(spacecraftState);
        result.setAcceleration(Vector3D.ZERO);
        return result;
    }
    
    Vector3D velocity = instant.getCartesianState().getVelocity();
    
    logger.debug("velocity = |{}| or {}", velocity.getNorm(), velocity);

    double dm = propulsion.getMassFlow() * maneuver.getThrottle() * dt;
    double thrust = propulsion.getMassFlow() * maneuver.getThrottle() * propulsion.getSpecificImpulse() * MathUtils.G0;
    double a = thrust / spacecraftState.getMass();

    SpacecraftState newSpacecraftState = new SpacecraftState();
    newSpacecraftState.setMass(spacecraftState.getMass() - dm);
    newSpacecraftState.setFuel(spacecraftState.getFuel() - dm);
    newSpacecraftState.setEngineActived(true);

    Vector3D acceleration;
    if (maneuver.isInverse()) {
    	acceleration = velocity.negate().normalize().scalarMultiply(a);
    } else {
    	Rotation r = new Rotation(RotationOrder.ZXZ, 0, maneuver.getThrottleAlpha(), maneuver.getThrottleDelta());
    	acceleration = r.applyTo(velocity.normalize()).scalarMultiply(a);
    }
    
    logger.debug("burst at {} with acceleration |{}| or vector {} ", TimeUtils.timeAsString(timestamp), acceleration.getNorm(), acceleration);

    result.setSpacecraftState(newSpacecraftState);
    result.setAcceleration(acceleration);
    
    return result;
}
 
开发者ID:momega,项目名称:spacesimulator2,代码行数:49,代码来源:ThrustModel.java

示例8: getAxialTilt

import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder; //导入依赖的package包/类
/**
 * Create rotation transformation based on the direction of the axial tilt
 * @param alpha the RA of the axial tilt
 * @param delta the DEC to the axial tilt
 * @param primeMeridian prime meridian
 * @param toEcliptic true if the values relates to the ecliptic. The value false if just for testing purposes
 * @return the rotation
 */
public Rotation getAxialTilt(double alpha, double delta, double primeMeridian, boolean toEcliptic) {
    double xAngle = (toEcliptic) ? -ECLIPTIC : 0d;
    Rotation tilt = new Rotation(RotationOrder.XZY, xAngle, alpha, Math.PI / 2 - delta);
    Rotation meridian = new Rotation(Vector3D.PLUS_K, primeMeridian);
    Rotation r = tilt.applyTo(meridian);
    return r;
}
 
开发者ID:momega,项目名称:spacesimulator2,代码行数:16,代码来源:RotationUtils.java


注:本文中的org.apache.commons.math3.geometry.euclidean.threed.RotationOrder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。