public double [ ] toECEF ( ) { double lon0r = toRadians ( this . longitude ) ; double lat0r = toRadians ( this . latitude ) ; double height = tools . feet2Meters ( altitude ) ; double v = a / Math . sqrt ( 1 - e2 * Math . sin ( lat0r ) * Math . sin ( lat0r ) ) ; return new double [ ] { ( v + height ) * Math . cos ( lat0r ) * Math . cos ( lon0r ) , // x ( v + height ) * Math . cos ( lat0r ) * Math . sin ( lon0r ) , // y ( v * ( 1 - e2 ) + height ) * Math . sin ( lat0r ) // z } ; }
Converts the WGS84 position to cartesian coordinates