15#include "IException.h"
16#include "TProjection.h"
19#include "PvlKeyword.h"
48 PvlGroup &mapGroup = label.findGroup(
"Mapping", Pvl::Traverse);
52 if ((allowDefaults) && (!mapGroup.hasKeyword(
"CenterLongitude"))) {
54 mapGroup += PvlKeyword(
"CenterLongitude",
toString(lon));
64 catch(IException &e) {
65 QString message =
"Invalid label group [Mapping]";
66 throw IException(e, IException::Io, message, _FILEINFO_);
84 if (!TProjection::operator==(proj))
return false;
131 bool Mollweide::newton_rapheson(
double phi,
double &result) {
137 theta[0] = asin(2*phi/PI);
142 while (dtheta > DBL_EPSILON) {
144 theta[1] = theta[0] - (2*theta[0]+sin(2*theta[0]) -(Isis::PI)*sin(phi))/(2+2*cos(theta[0]));
145 dtheta = fabs(theta[1]-theta[0]);
149 if (niter > 15000000) {
182 double latRadians = lat * PI / 180.0;
183 double lonRadians = lon * PI / 180.0;
189 if (newton_rapheson(latRadians,theta) ) {
227 m_latitude = asin((2*theta+sin(2*theta))/(Isis::PI));
230 if (fabs(HALFPI - fabs(
m_latitude)) > DBL_EPSILON) {
246 if (cosLat <= DBL_EPSILON) {
298 double &minY,
double &maxY) {
379 bool allowDefaults) {
Mollweide Map Projection.
QString Version() const
Returns the version of the map projection.
PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
bool operator==(const Projection &proj)
Compares two Projection objects to see if they are equal.
PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
Mollweide(Pvl &label, bool allowDefaults=false)
Constructs a Mollweide object.
double m_centerLongitude
The center longitude for the map projection.
bool XYRange(double &minX, double &maxX, double &minY, double &maxY)
This method is used to determine the x/y range which completely covers the area of interest specified...
~Mollweide()
Destroys the Mollweide object.
bool SetGround(const double lat, const double lon)
This method is used to set the latitude/longitude (assumed to be of the correct LatitudeType,...
PvlGroup Mapping()
This function returns the keywords that this projection uses.
bool SetCoordinate(const double x, const double y)
This method is used to set the projection x/y.
QString Name() const
Returns the name of the map projection, "Mollweide".
Base class for Map Projections.
double m_maximumX
See minimumX description.
double GetX() const
Calculates the unrotated form of current x value.
bool m_good
Indicates if the contents of m_x, m_y, m_latitude, and m_longitude are valid.
double m_minimumX
The data elements m_minimumX, m_minimumY, m_maximumX, and m_maximumY are convience data elements when...
PvlGroup m_mappingGrp
Mapping group that created this projection.
double m_minimumY
See minimumX description.
void SetXY(double x, double y)
This protected method is a helper for derived classes.
double m_maximumY
See minimumX description.
void SetComputedXY(double x, double y)
This protected method is a helper for derived classes.
Base class for Map TProjections.
double m_longitude
This contains the currently set longitude value.
double m_minimumLatitude
Contains the minimum latitude for the entire ground range.
double m_maximumLongitude
Contains the maximum longitude for the entire ground range.
double m_equatorialRadius
Polar radius of the target.
LongitudeDirection m_longitudeDirection
An enumerated type indicating the LongitudeDirection read from the labels.
virtual PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
void XYRangeCheck(const double latitude, const double longitude)
This convience function is established to assist in the development of the XYRange virtual method.
virtual PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
double m_minimumLongitude
Contains the minimum longitude for the entire ground range.
@ PositiveWest
Longitude values increase in the westerly direction.
double m_maximumLatitude
Contains the maximum latitude for the entire ground range.
TProjection(Pvl &label)
Constructs an empty TProjection object.
virtual PvlGroup Mapping()
This function returns the keywords that this projection uses.
double m_latitude
This contains the currently set latitude value.
This is free and unencumbered software released into the public domain.
QString toString(const LinearAlgebra::Vector &vector, int precision)
A global function to format LinearAlgebra::Vector as a QString with the given precision.
Namespace for the standard library.