dimanche 23 septembre 2018

lat lon convert to cartesian coordinates then convert back

I'm doing tracking of target. The sensor platform is given in lat lon and the target is given in local azimuth and range. The following is my pseudo codes.

reflatlon = //some reference point on the map in lat lon

platformlatlon = //platform lat lon

refxyz = latlon2xyz(reflatlon)

platformxyz = latlon2xyz(platformlatlon)

enu = xyz2enu(platformlatlon, refxyz)

//suppose the target is to the west of the platform (270deg from true north and 600m away so need to minus 600 from x-axis)

enu[0] = enu[0] - 600

xyz = enu2xyz(enu, refxyz)

targetlatlon = xyz2latlon(xyz)

However, the returned latlon is to the east of the platform. Does anyone knows what is wrong?

Thanks

Aucun commentaire:

Enregistrer un commentaire