Skip to main content

Geo functions

heading

Commentary

added in 0.3.3

Given a pair of starting and ending coordinates, calculates the heading in degrees, assuming a straight line.


Examples

Apply heading

{
"_gen": "heading",
"src": [
37.79254818258253,
-122.24934557257774
],
"dst": [
37.765734798650634,
-117.30763932906169
]
}
[
272.658788219642
]

Specification

JSON schema

{
"type": "object",
"properties": {
"src": {
"oneOf": [
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
},
"dst": {
"oneOf": [
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
},
"unit": {
"type": "string",
"enum": [
"degrees",
"radians"
]
}
},
"required": [
"src",
"dst"
]
}