當前位置: 首頁>>代碼示例>>Java>>正文


Java RotationConvention類代碼示例

本文整理匯總了Java中org.apache.commons.math3.geometry.euclidean.threed.RotationConvention的典型用法代碼示例。如果您正苦於以下問題:Java RotationConvention類的具體用法?Java RotationConvention怎麽用?Java RotationConvention使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RotationConvention類屬於org.apache.commons.math3.geometry.euclidean.threed包,在下文中一共展示了RotationConvention類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: toCamera

import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention; //導入依賴的package包/類
/**
 * Transform this horizontal coordinate to the camera frame for the given pointing position and focal length.
 *
 * @param pointingPosition Pointing of the telescope
 * @param focalLength      focalLength of the telescope
 * @return coordinate transformed into the camera frame
 */
public CameraCoordinate toCamera(HorizontalCoordinate pointingPosition, double focalLength) {

    double paz = pointingPosition.getAzimuthRad();
    double pzd = pointingPosition.getZenithRad();
    double saz = this.getAzimuthRad();
    double szd = this.getZenithRad();

    Vector3D vec = new Vector3D(Math.sin(szd) * Math.cos(saz), Math.sin(szd) * Math.sin(saz), Math.cos(szd));

    Rotation rotZAz = new Rotation(new Vector3D(0.0, 0.0, 1.0), -paz, RotationConvention.VECTOR_OPERATOR);
    Rotation rotYZd = new Rotation(new Vector3D(0.0, 1.0, 0.0), -pzd, RotationConvention.VECTOR_OPERATOR);

    Vector3D rotVec = rotYZd.applyTo(rotZAz.applyTo(vec));

    double x = rotVec.getX();
    double y = rotVec.getY();
    double z = rotVec.getZ();

    CameraCoordinate cameraCoordinate = new CameraCoordinate(x * (focalLength) / z, y * (focalLength) / z);

    return cameraCoordinate;
}
 
開發者ID:fact-project,項目名稱:fact-tools,代碼行數:30,代碼來源:HorizontalCoordinate.java

示例2: createRegularPolygonVertices

import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention; //導入依賴的package包/類
/** Build the vertices representing a regular polygon.
 * @param center center of the polygon (the center is in the inside half)
 * @param meridian point defining the reference meridian for first polygon vertex
 * @param outsideRadius distance of the vertices to the center
 * @param n number of sides of the polygon
 * @return vertices array
 */
private static S2Point[] createRegularPolygonVertices(final Vector3D center, final Vector3D meridian,
                                                      final double outsideRadius, final int n) {
    final S2Point[] array = new S2Point[n];
    final Rotation r0 = new Rotation(Vector3D.crossProduct(center, meridian),
                                     outsideRadius, RotationConvention.VECTOR_OPERATOR);
    array[0] = new S2Point(r0.applyTo(center));

    final Rotation r = new Rotation(center, MathUtils.TWO_PI / n, RotationConvention.VECTOR_OPERATOR);
    for (int i = 1; i < n; ++i) {
        array[i] = new S2Point(r.applyTo(array[i - 1].getVector()));
    }

    return array;
}
 
開發者ID:biocompibens,項目名稱:SME,代碼行數:22,代碼來源:SphericalPolygonsSet.java

示例3: toHorizontal

import org.apache.commons.math3.geometry.euclidean.threed.RotationConvention; //導入依賴的package包/類
/**
 * Transform this CameraCoordinate from camera frame to telescope (horizontal coordinates) frame
 * for the given PointingPosition.
 *
 * @param pointingPosition the telescope's pointing position
 * @param focalLength      the focal length of the telescope
 * @return the camera coordinate transformed into the horizontal coordinate frame
 */
public HorizontalCoordinate toHorizontal(HorizontalCoordinate pointingPosition, double focalLength) {

    double paz = pointingPosition.getAzimuthRad();
    double pzd = pointingPosition.getZenithRad();

    double z = 1 / Math.sqrt(1 + Math.pow(xMM / focalLength, 2.0) + Math.pow(yMM / focalLength, 2.0));
    double x = xMM * z / focalLength;
    double y = yMM * z / focalLength;

    Vector3D vec = new Vector3D(x, y, z);

    Rotation rotZAz = new Rotation(new Vector3D(0.0, 0.0, 1.0), -paz, RotationConvention.VECTOR_OPERATOR);
    Rotation rotYZd = new Rotation(new Vector3D(0.0, 1.0, 0.0), -pzd, RotationConvention.VECTOR_OPERATOR);

    Vector3D rotVec = rotZAz.applyInverseTo(rotYZd.applyInverseTo(vec));

    double zenith = Math.acos(rotVec.getZ());
    double azimuth = Math.atan2(rotVec.getY(), rotVec.getX());

    return HorizontalCoordinate.fromRad(zenith, azimuth);
}
 
開發者ID:fact-project,項目名稱:fact-tools,代碼行數:30,代碼來源:CameraCoordinate.java


注:本文中的org.apache.commons.math3.geometry.euclidean.threed.RotationConvention類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。