-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using converter functions everywhere
Signed-off-by: Cédric Foellmi <[email protected]>
- Loading branch information
1 parent
a4ab31d
commit d221999
Showing
17 changed files
with
114 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
import Decimal from '@/decimal' | ||
import { Degree, JulianCentury, JulianDay, Radian } from '@/types' | ||
import { DEG2RAD } from '@/constants' | ||
import { getJulianCentury } from '@/juliandays' | ||
|
||
export function getCorrectionInLongitude (jd: JulianDay | number, lng: Degree | number, lat: Degree | number): Degree { | ||
const T = getJulianCentury(jd) | ||
let Ldash: Radian = new Decimal(lng) | ||
.minus(new Decimal(1.397).mul(T)) | ||
.minus(new Decimal(0.00031).mul(T.pow(2))) | ||
.mul(DEG2RAD) | ||
const value = new Decimal(-0.09033) | ||
.plus(new Decimal(0.03916) | ||
.minus(new Decimal('1.397').mul(T)) | ||
.minus(new Decimal('0.000_31').mul(T.pow(2))) | ||
.degreesToRadians() | ||
const value = new Decimal('-0.090_33') | ||
.plus(new Decimal('0.039_16') | ||
.mul(Ldash.cos().plus(Ldash.sin())) | ||
.mul(new Decimal(lat).mul(DEG2RAD).tan())) | ||
return value.dividedBy(3600) | ||
.mul(new Decimal(lat).degreesToRadians().tan())) | ||
return value.dividedBy('3600') | ||
} | ||
|
||
export function getCorrectionInLatitude (jd: JulianDay | number, lng: Degree | number): Degree { | ||
const T: JulianCentury = getJulianCentury(jd) | ||
let Ldash: Radian = new Decimal(lng) | ||
.minus(new Decimal(1.397).mul(T)) | ||
.minus(new Decimal(0.00031).mul(T.pow(2))) | ||
.mul(DEG2RAD) | ||
const value = new Decimal(0.03916).mul(Ldash.cos().minus(Ldash.sin())) | ||
return value.dividedBy(3600) | ||
.minus(new Decimal('1.397').mul(T)) | ||
.minus(new Decimal('0.000_31').mul(T.pow(2))) | ||
.degreesToRadians() | ||
const value = new Decimal('0.039_16').mul(Ldash.cos().minus(Ldash.sin())) | ||
return value.dividedBy('3600') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.