GPS code problem

I cant understand what are these expressions say'n can u
[# if (gps.gprmc_status() == 'A') {
// calculate relative direction to destination
dir = gps.gprmc_course_to(dest_latitude, dest_longitude) - gps.gprmc_course();

if (dir < 0)
dir += 360;
if (dir > 180)
dir -= 360;
]

Pretty much, yes.
But some context would be helpful.
What is it you don't understand?

Sir its
[ gps.gprmc_course_to and gps.gprmc_course]these two statement return s the direction in degrees but my question is this how he computes his direction through this code
[ // calculate relative direction to destination
dir = gps.gprmc_course_to(dest_latitude, dest_longitude) - gps.gprmc_course();

if (dir < 0)
dir += 360;
if (dir > 180)
dir -= 360; ]

Can u brief the code to me

Can u brief the code to me