/** * Rotate vector counter-clockwise in x-z by an angle. */ public Vector rotateXZ(final double angle) { return rotateXZ(Math.sin(angle), Math.cos(angle)); }
/** * Modify a point to produce a vector in translated/rotated space. * @param start is the start point. * @param transX is the translation x value. * @param transY is the translation y value. * @param transZ is the translation z value. * @param sinRA is the sine of the ascension angle. * @param cosRA is the cosine of the ascension angle. * @param sinHA is the sine of the height angle. * @param cosHA is the cosine of the height angle. * @return the modified point. */ protected static Vector modify(final GeoPoint start, final double transX, final double transY, final double transZ, final double sinRA, final double cosRA, final double sinHA, final double cosHA) { return start.translate(transX, transY, transZ).rotateXY(sinRA, cosRA).rotateXZ(sinHA, cosHA); }
/** * Reverse modify a point to produce a GeoPoint in normal space. * @param planetModel is the planet model. * @param point is the translated point. * @param transX is the translation x value. * @param transY is the translation y value. * @param transZ is the translation z value. * @param sinRA is the sine of the ascension angle. * @param cosRA is the cosine of the ascension angle. * @param sinHA is the sine of the height angle. * @param cosHA is the cosine of the height angle. * @return the original point. */ protected static GeoPoint reverseModify(final PlanetModel planetModel, final Vector point, final double transX, final double transY, final double transZ, final double sinRA, final double cosRA, final double sinHA, final double cosHA) { final Vector result = point.rotateXZ(-sinHA, cosHA).rotateXY(-sinRA, cosRA).translate(-transX, -transY, -transZ); return planetModel.createSurfacePoint(result.x, result.y, result.z); }