Package pygeodesy :: Module rhumbx :: Class Rhumb |
[frames] | no frames]

# Class Rhumb

      object --+
               |
    named._Named --+
                   |
    named._NamedBase --+
                       |
        karney._CapsBase --+
                           |
                          Rhumb

Class to solve of the direct and inverse rhumb problems, accurately.

See Also: The Detailed Description of Karney's C++ `Rhumb Class`.

Instance Methods
__init__(self, a_earth=Ellipsoid(name='WGS84', a=6378137, b=6356752.31424518, f_=298.`...`, f=None, exact=True, name='', **RA_TMorder) New Rhumb. |
Direct(self, lat1, lon1, azi12, s12, outmask=384) Solve the direct rhumb problem, optionally with the area. |
Direct7(self, lat1, lon1, azi12, s12, outmask=16768) DEPRECATED, use method Rhumb.Direct8. |
Direct8(self, lat1, lon1, azi12, s12, outmask=16768) Like method Rhumb.Direct but returning a Rhumb8Tuple with area `S12`. |
DirectLine(self, lat1, lon1, azi12, name='', **caps) Define a RhumbLine in terms of the direct rhumb problem. |
flattening(self) Get the `ellipsoid`'s flattening (`float`). |
f(self) Get the `ellipsoid`'s flattening (`float`). |
Inverse(self, lat1, lon1, lat2, lon2, outmask=1536) Solve the inverse rhumb problem. |
Inverse7(self, lat1, lon1, azi12, s12, outmask=17920) DEPRECATED, use method Rhumb.Inverse8. |
Inverse8(self, lat1, lon1, azi12, s12, outmask=17920) Like method Rhumb.Inverse but returning a Rhumb8Tuple with area `S12`. |
InverseLine(self, lat1, lon1, lat2, lon2, name='', **caps) Define a RhumbLine in terms of the inverse rhumb problem. |
Line(self, lat1, lon1, azi12, name='', **caps) Define a RhumbLine in terms of the direct rhumb problem. |
orders(self, RAorder=None, TMorder=None) Get and set the RAorder and/or TMorder. |
toStr(self, prec=6, sep=', ', **unused) Return this `Rhumb` as string. |
Inherited from `karney._CapsBase`: `caps_` Inherited from `named._NamedBase`: `__repr__`, `__str__`, `others`, `toRepr` Inherited from `named._Named`: `__imatmul__`, `__matmul__`, `__rmatmul__`, `attrs`, `classof`, `copy`, `dup`, `rename`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Class Variables
Inherited from `karney._CapsBase`: `ALL`, `AREA`, `AZIMUTH`, `DISTANCE`, `DISTANCE_IN`, `EMPTY`, `GEODESICSCALE`, `LATITUDE`, `LINE_OFF`, `LONGITUDE`, `LONG_UNROLL`, `REDUCEDLENGTH`, `STANDARD`

Properties
| ellipsoid Get this rhumb's ellipsoid (Ellipsoid).
| equatoradius Get the `ellipsoid`'s equatorial radius, semi-axis (`meter`).
| a Get the `ellipsoid`'s equatorial radius, semi-axis (`meter`).
| exact Get the exact option (`bool`).
| RAorder Get the Rhumb Area order (`int`, 4, 5, 6, 7 or 8).
| TMorder Get the Transverse Mercator order (`int`, 4, 5, 6, 7 or 8).
Inherited from `karney._CapsBase`: `caps`, `debug` Inherited from `named._Named`: `classname`, `classnaming`, `iteration`, `name`, `named`, `named2`, `named3`, `named4` Inherited from `object`: `__class__`

Method Details

### __init__ (self, a_earth=Ellipsoid(name='WGS84', a=6378137, b=6356752.31424518, f_=298.`...`, f=None, exact=True, name='', **RA_TMorder) (Constructor) |
New Rhumb. Arguments: `a_earth` - This rhumb's earth (Ellipsoid, Ellipsoid2, a_f2Tuple, Datum, 2-tuple `(a, f)`) or the (equatorial) radius (`scalar`). `f` - The ellipsoid's flattening (`scalar`), iff `a_earth` is a `scalar`, ignored otherwise. `exact` - If `True`, use an addition theorem for elliptic integrals to compute Divided differences, otherwise use the Krüger series expansion (`bool`), see also property `exact`. `name` - Optional name (`str`). `RA_TMorder` - Optional keyword arguments `RAorder` and `TMorder` to set the respective `order`, see properties `RAorder` and `TMorder` and method `orders`. Raises: `RhumbError` - Invalid `a_earth`, `f` or `RA_TMorder`. Overrides: object.__init__

### Direct (self, lat1, lon1, azi12, s12, outmask=384) |
Solve the direct rhumb problem, optionally with the area. Arguments: `lat1` - Latitude of the first point (`degrees90`). `lon1` - Longitude of the first point (`degrees180`). `azi12` - Azimuth of the rhumb line (compass `degrees`). `s12` - Distance along the rhumb line from the given to the destination point (`meter`), can be negative. Returns: GDict with 2 up to 8 items `lat2, lon2, a12, S12, lat1, lon1, azi12, s12` with the destination point's latitude `lat2` and longitude `lon2` in `degrees`, the rhumb angle `a12` in `degrees` and area `S12` under the rhumb line in `meter` squared. Note: If `s12` is large enough that the rhumb line crosses a pole, the longitude of the second point is indeterminate and `NAN` is returned for `lon2` and area `S12`. If the given point is a pole, the cosine of its latitude is taken to be `epsilon`**-2 (where `epsilon` is 2.0**-52. This position is extremely close to the actual pole and allows the calculation to be carried out in finite terms.

### Direct7 (self, lat1, lon1, azi12, s12, outmask=16768) |
DEPRECATED, use method Rhumb.Direct8. Returns: A DEPRECATED Rhumb7Tuple. Decorators: `@deprecated_method`

### DirectLine (self, lat1, lon1, azi12, name='', **caps) |
Define a RhumbLine in terms of the direct rhumb problem. Arguments: `lat1` - Latitude of the first point (`degrees90`). `lon1` - Longitude of the first point (`degrees180`). `azi12` - Azimuth of the rhumb line (compass `degrees`). `caps` - Optional `caps`, see RhumbLine `caps`. Returns: A RhumbLine instance and invoke its method RhumbLine.Position to compute each point. Note: Updates to this rhumb are reflected in the returned rhumb line.

### Inverse (self, lat1, lon1, lat2, lon2, outmask=1536) |
Solve the inverse rhumb problem. Arguments: `lat1` - Latitude of the first point (`degrees90`). `lon1` - Longitude of the first point (`degrees180`). `lat2` - Latitude of the second point (`degrees90`). `lon2` - Longitude of the second point (`degrees180`). Returns: GDict with 5 to 8 items `azi12, s12, a12, S12, lat1, lon1, lat2, lon2`, the rhumb line's azimuth `azi12` in compass `degrees` between `-180` and `+180`, the distance `s12` and rhumb angle `a12` between both points in `meter` respectively `degrees` and the area `S12` under the rhumb line in `meter` squared. Note: The shortest rhumb line is found. If the end points are on opposite meridians, there are two shortest rhumb lines and the East-going one is chosen. If either point is a pole, the cosine of its latitude is taken to be `epsilon`**-2 (where `epsilon` is 2.0**-52). This position is extremely close to the actual pole and allows the calculation to be carried out in finite terms.

### Inverse7 (self, lat1, lon1, azi12, s12, outmask=17920) |
DEPRECATED, use method Rhumb.Inverse8. Returns: A DEPRECATED Rhumb7Tuple. Decorators: `@deprecated_method`

### InverseLine (self, lat1, lon1, lat2, lon2, name='', **caps) |
Define a RhumbLine in terms of the inverse rhumb problem. Arguments: `lat1` - Latitude of the first point (`degrees90`). `lon1` - Longitude of the first point (`degrees180`). `lat2` - Latitude of the second point (`degrees90`). `lon2` - Longitude of the second point (`degrees180`). `caps` - Optional `caps`, see RhumbLine `caps`. Returns: A RhumbLine instance and invoke its method RhumbLine.Position to compute each point. Note: Updates to this rhumb are reflected in the returned rhumb line.

### Line (self, lat1, lon1, azi12, name='', **caps) |
Define a RhumbLine in terms of the direct rhumb problem. Arguments: `lat1` - Latitude of the first point (`degrees90`). `lon1` - Longitude of the first point (`degrees180`). `azi12` - Azimuth of the rhumb line (compass `degrees`). `caps` - Optional `caps`, see RhumbLine `caps`. Returns: A RhumbLine instance and invoke its method RhumbLine.Position to compute each point. Note: Updates to this rhumb are reflected in the returned rhumb line.

### orders (self, RAorder=None, TMorder=None) |
Get and set the RAorder and/or TMorder. Arguments: `RAorder` - Rhumb Area order (`int`, 4, 5, 6, 7 or 8). `TMorder` - Transverse Mercator order (`int`, 4, 5, 6, 7 or 8). Returns: RhumbOrder2Tuple`(RAorder, TMorder)` with the previous `RAorder` and `TMorder` setting.

### toStr (self, prec=6, sep=', ', **unused) |
Return this `Rhumb` as string. Arguments: `prec` - The `float` precision, number of decimal digits (0..9). Trailing zero decimals are stripped for `prec` values of 1 and above, but kept for negative `prec` values. `sep` - Separator to join (`str`). Returns: Tuple items (`str`). Overrides: named._Named.toStr

Property Details

### ellipsoid Get this rhumb's ellipsoid (Ellipsoid). Get method: ellipsoid(self) - Get this rhumb's ellipsoid (Ellipsoid). Set method: ellipsoid(self, a_earth_f) - Set this rhumb's ellipsoid (Ellipsoid, Ellipsoid2, Datum, a_f2Tuple, 2-tuple `(a, f)`) or the (equatorial) radius (`scalar`). Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### equatoradius Get the `ellipsoid`'s equatorial radius, semi-axis (`meter`). Get method: equatoradius(self) - Get the `ellipsoid`'s equatorial radius, semi-axis (`meter`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### a Get the `ellipsoid`'s equatorial radius, semi-axis (`meter`). Get method: equatoradius(self) - Get the `ellipsoid`'s equatorial radius, semi-axis (`meter`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### exact Get the exact option (`bool`). Get method: exact(self) - Get the exact option (`bool`). Set method: exact(self, exact) - Set the exact option (`bool`). Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### RAorder Get the Rhumb Area order (`int`, 4, 5, 6, 7 or 8). Get method: RAorder(self) - Get the Rhumb Area order (`int`, 4, 5, 6, 7 or 8). Set method: RAorder(self, order) - Set the Rhumb Area order (`int`, 4, 5, 6, 7 or 8). Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### TMorder Get the Transverse Mercator order (`int`, 4, 5, 6, 7 or 8). Get method: TMorder(self) - Get the Transverse Mercator order (`int`, 4, 5, 6, 7 or 8). Set method: TMorder(self, order) - Set the Transverse Mercator order (`int`, 4, 5, 6, 7 or 8). Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.