Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`positioning`.`base`.`Heading``

class documentation

`class Heading(Angle): (source)`

Constructor: `Heading(angle, variation)`

View In Hierarchy

The heading of a mobile object.

Class Method | `fromFloats` | Constructs a Heading from the float values of the angle and variation.
Method | `__init__` | Initializes an angle with an optional variation.
Method | `__repr__` | Returns a string representation of this angle.
Method | `setSign` | Sets the sign of the variation of this heading.
Class Variable | `compareAttributes` | Undocumented
Instance Variable | `variation` | The (optional) magnetic variation. The sign of the variation is positive for variations towards the east (clockwise from north), and negative for variations towards the west (counterclockwise from north)...
Property | `correctedHeading` | Corrects the heading by the given variation. This is sometimes known as the true heading.

Inherited from `Angle`:

Method | `__float__` | Returns this angle as a float.
Instance Variable | `angleType` | Undocumented
Property | `inDecimalDegrees` | The value of this angle in decimal degrees. This value is immutable.
Property | `inDegreesMinutesSeconds` | The value of this angle as a degrees, minutes, seconds tuple. This value is immutable.
Constant | `_ANGLE_TYPE_NAMES` | English names for angle types.
Constant | `_RANGE_EXPRESSIONS` | A collection of expressions for the allowable range for the angular value of a particular coordinate value.
Instance Variable | `_angle` | Undocumented
Property | `_angleTypeNameRepr` | Returns a string representation of the type of this angle.
Property | `_angleValueRepr` | Returns a string representation of the angular value of this angle.

Inherited from `FancyEqMixin` (via `Angle`):

Method | `__eq__` | Undocumented
Method | `__ne__` | Undocumented

@classmethod
def fromFloats(cls, angleValue=None, variationValue=None): (source)

Constructs a Heading from the float values of the angle and variation.

Parameters
angleValue:`float` | The angle value of this heading.
variationValue:`float` | The value of the variation of this heading.
Returns
A `Heading` with the given values.

def __init__(self, angle=None, variation=None): (source)
overrides `twisted.positioning.base.Angle.__init__`

Initializes an angle with an optional variation.

def __repr__(self) -> `str`: (source)
overrides `twisted.positioning.base.Angle.__repr__`

Returns a string representation of this angle.

Returns
`str` | The string representation.

def setSign(self, sign): (source)
overrides `twisted.positioning.base.Angle.setSign`

Sets the sign of the variation of this heading.

Parameters
sign:`int` | The new sign. `1` for positive and `-1` for negative signs, respectively.
Raises
`ValueError` | If the `sign` parameter is not `-1` or `1`.

compareAttributes = (source)
overrides `twisted.positioning.base.Angle.compareAttributes`

Undocumented

variation: `Angle` or `None`. = (source)

The (optional) magnetic variation. The sign of the variation is positive for variations towards the east (clockwise from north), and negative for variations towards the west (counterclockwise from north). If the variation is unknown or not applicable, this is `None`.

@property
correctedHeading: `float` or `None` = (source)

Corrects the heading by the given variation. This is sometimes known as the true heading.