Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ghsc
Hazards Development Team
earthquake-geoserve-ui
Commits
87431e89
Commit
87431e89
authored
Sep 25, 2019
by
Jeremy M Fee
Committed by
Edward J Hunter
Oct 15, 2021
Browse files
Reverse azimuth correction, so it starts from reference place
parent
602c5be0
Changes
2
Show whitespace changes
Inline
Side-by-side
projects/hazdev-ng-geoserve-output/src/lib/distance-azimuth.pipe.spec.ts
View file @
87431e89
...
...
@@ -49,7 +49,7 @@ describe('DistanceAzimuthPipe', () => {
});
it
(
'
should accept a referencePlace
'
,
()
=>
{
expect
(
pipe
.
transform
(
place
,
referencePlace
)).
toEqual
(
'
447.3 km (277.9 mi)
N
'
'
447.3 km (277.9 mi)
S
'
);
});
});
...
...
projects/hazdev-ng-geoserve-output/src/lib/distance-azimuth.ts
View file @
87431e89
...
...
@@ -13,12 +13,12 @@ export interface DistanceAzimuth {
* Compute distance and azimuth from place to reference place.
*
* @param place
*
starting
place.
*
destination
place.
* @param referencePlace
* optional
destination
place.
* optional
starting
place.
* @return
* When reference place is specified:
* calculate direction and azimuth from
place to
referencePlace.
* calculate direction and azimuth from referencePlace
to place
.
* Otherwise return distance and azimuth from place.
*/
export
function
getDistanceAzimuth
(
...
...
@@ -32,13 +32,13 @@ export function getDistanceAzimuth(
const
distAz
=
calculator
.
azimuth
(
{
elv
:
0
,
lat
:
p
lace
.
latitude
,
lng
:
p
lace
.
longitude
lat
:
referenceP
lace
.
latitude
,
lng
:
referenceP
lace
.
longitude
},
{
elv
:
0
,
lat
:
referenceP
lace
.
latitude
,
lng
:
referenceP
lace
.
longitude
lat
:
p
lace
.
latitude
,
lng
:
p
lace
.
longitude
}
);
azimuth
=
distAz
.
azimuth
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment