Skip to content

Commit

Permalink
feat: add calculateB to vsop87 module in @observerly/astrometry
Browse files Browse the repository at this point in the history
feat: add calculateB to vsop87 module in @observerly/astrometry
  • Loading branch information
michealroberts committed Aug 9, 2024
1 parent 0baf417 commit df736cf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/vsop87.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,17 @@ export function calculateL(τ: number, terms: { A: number; B: number; C: number
}

/*****************************************************************************************************************/

export function calculateB(τ: number, terms: { A: number; B: number; C: number }[][]): number {
let B = 0

for (let i = 0; i < terms.length; i++) {
const b = calculateTerms(τ, terms[i])
B += b * τ ** i
}

// The result must be converted from 1e-8 radians to radians and then to degrees:
return degrees(B / 1e8)
}

/*****************************************************************************************************************/

0 comments on commit df736cf

Please sign in to comment.