The distance in metres between two points in gmaps is like this:

    P1.distanceFrom(P2)


The tutorial page links to an example that has an algorithm for calculating bearing: http://www.econym.org.uk/gmap/dist.htm