Construct a polyline between the original two points. Then use the isLocationOnEdge function to determine if the 3rd point is within a certain number of degrees from your polyline.
e.g.
<!DOCTYPE html>
<html>
<head>
<title>Is a point within x degrees of a polyline</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { width:100%; height:100%; }
</style>
<!-- need to load the geometry library -->
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=geometry&sensor=false"></script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(54.5003526, -3.0844116);
var myOptions = {
zoom: 10,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({
position: latlng,
map: map,
title: "foo"
});
var latLng1 = new google.maps.LatLng(54.60039, -3.13632);
var latLng2 = new google.maps.LatLng(54.36897, -3.07561);
var polyline = new google.maps.Polyline({
path: [latLng1, latLng2],
strokeColor: "#FF0000",
strokeOpacity: 1.0,
strokeWeight: 2,
map: map
});
console.log(google.maps.geometry.poly.isLocationOnEdge(latlng, polyline));
console.log(google.maps.geometry.poly.isLocationOnEdge(latlng, polyline, 1));
console.log(google.maps.geometry.poly.isLocationOnEdge(latlng, polyline, 0.1));
console.log(google.maps.geometry.poly.isLocationOnEdge(latlng, polyline, 0.01));
console.log(google.maps.geometry.poly.isLocationOnEdge(latlng, polyline, 0.001));
console.log(google.maps.geometry.poly.isLocationOnEdge(latlng, polyline, 0.0001));
console.log(google.maps.geometry.poly.isLocationOnEdge(latlng, polyline, 0.00001));
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map_canvas"></div>
</body>
</html>
Doing this I can see my point is within 0.1 degree from my line, but it's not within 0.01 degree of it. Your tolerance in degrees will vary depending on situation.