package ballistics.utils.earth

import ballistics.types.BLHPoint
import ballistics.utils.math.Vector3D

abstract class AbstractEarth {
    var fM = 398600.44e9
    var ekvRadius = 6378136.0
    var wEarth = 0.7292115e-4
    var alphaEllips = 1 / 298.257839303
    var middleRadius = 6378100.0
    var polarRadius = (1 - alphaEllips) * ekvRadius
    var c20 = -1.08262741e-3
    var eElips2 = 2 * alphaEllips - alphaEllips * alphaEllips

    fun blh2xyz(blh: BLHPoint): Vector3D {
        return blh2xyz(blh.lat, blh.long, blh.h)
    }

    abstract fun blh2xyz(
        b: Double,
        l: Double,
        h: Double,
    ): Vector3D

    abstract fun xyz2blh(r: Vector3D): BLHPoint
}
