net.sf.geographiclib.GeodesicMask Maven / Gradle / Ivy
Show all versions of GeographicLib-Java Show documentation
/**
* Implementation of the net.sf.geographiclib.GeodesicMask class
*
* Copyright (c) Charles Karney (2013-2014) and licensed
* under the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/
**********************************************************************/
package net.sf.geographiclib;
/**
* Bit masks for what geodesic calculations to do.
*
* These masks do double duty. They specify (via the outmask parameter)
* which results to return in the {@link GeodesicData} object returned by the
* general routines {@link Geodesic#Direct(double, double, double, double, int)
* Geodesic.Direct} and {@link Geodesic#Inverse(double, double, double, double,
* int) Geodesic.Inverse} routines. They also signify (via the caps
* parameter) to the {@link GeodesicLine#GeodesicLine(Geodesic, double, double,
* double, int) GeodesicLine.GeodesicLine} constructor and to {@link
* Geodesic#Line(double, double, double, int) Geodesic.Line} what capabilities
* should be included in the {@link GeodesicLine} object.
**********************************************************************/
public class GeodesicMask {
protected static final int CAP_NONE = 0;
protected static final int CAP_C1 = 1<<0;
protected static final int CAP_C1p = 1<<1;
protected static final int CAP_C2 = 1<<2;
protected static final int CAP_C3 = 1<<3;
protected static final int CAP_C4 = 1<<4;
protected static final int CAP_ALL = 0x1F;
protected static final int CAP_MASK = CAP_ALL;
protected static final int OUT_ALL = 0x7F80;
protected static final int OUT_MASK = 0xFF80; // Include LONG_UNROLL
/**
* No capabilities, no output.
**********************************************************************/
public static final int NONE = 0;
/**
* Calculate latitude lat2. (It's not necessary to include this as a
* capability to {@link GeodesicLine} because this is included by default.)
**********************************************************************/
public static final int LATITUDE = 1<<7 | CAP_NONE;
/**
* Calculate longitude lon2.
**********************************************************************/
public static final int LONGITUDE = 1<<8 | CAP_C3;
/**
* Calculate azimuths azi1 and azi2. (It's not necessary to
* include this as a capability to {@link GeodesicLine} because this is
* included by default.)
**********************************************************************/
public static final int AZIMUTH = 1<<9 | CAP_NONE;
/**
* Calculate distance s12.
**********************************************************************/
public static final int DISTANCE = 1<<10 | CAP_C1;
/**
* All of the above, the "standard" output and capabilities.
**********************************************************************/
public static final int STANDARD = LATITUDE | LONGITUDE |
AZIMUTH | DISTANCE;
/**
* Allow distance s12 to be used as input in the direct
* geodesic problem.
**********************************************************************/
public static final int DISTANCE_IN = 1<<11 | CAP_C1 | CAP_C1p;
/**
* Calculate reduced length m12.
**********************************************************************/
public static final int REDUCEDLENGTH = 1<<12 | CAP_C1 | CAP_C2;
/**
* Calculate geodesic scales M12 and M21.
**********************************************************************/
public static final int GEODESICSCALE = 1<<13 | CAP_C1 | CAP_C2;
/**
* Calculate area S12.
**********************************************************************/
public static final int AREA = 1<<14 | CAP_C4;
/**
* All capabilities, calculate everything. (LONG_UNROLL is not included in
* this mask.)
**********************************************************************/
public static final int ALL = OUT_ALL| CAP_ALL;
/**
* Unroll lon2.
**********************************************************************/
public static final int LONG_UNROLL = 1<<15;
}