All files / core/systems/ecef system.ts

100% Statements 3/3
100% Branches 0/0
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22          14x         58x 58x                    
import { Option } from 'effect'
 
import type { Formatter } from '../types'
import { toEcef } from './ecef'
 
export const formatter: Formatter = {
  id: 'ECEF',
  label: 'ECEF',
  maybeGridId: Option.none(),
  format: point => {
    const { x, y, z } = toEcef(point)
    return {
      // NOTE: the app has no heights, so the point is on the ellipsoid (h 0 m); the second line says so.
      lines: [
        `x ${x.toFixed(0)} y ${y.toFixed(0)}`,
        `z ${z.toFixed(0)} ยท h 0 m`,
      ],
      copyText: `${x.toFixed(2)}, ${y.toFixed(2)}, ${z.toFixed(2)}`,
    }
  },
}