startmacro n:lat1[44.0] n:lon1[33.0] n:lat2[45.0] n:lon2[34.0]

local miss

  callp geoToCartesian lat1 lon1 missloc1

  callp geoToCartesian lat2 lon2 missloc2

  calc miss missloc1(1;1) missloc2(1;1) - mag

  say "Miss distance is ^miss meters"

  erase missloc1 missloc2
  
endmacro

!******************************************************************************!
procedure geoToCartesian n:lat n:lon U:locFile

  location ^locFile lat lon 0           ! Creates a file
  transform ^locFile ^locFile ecr cart  ! Transforms from ECR to CART

return
