You could use Manhattan (a.k.a. L1) distance, that is, check if abs($x - $x0) + abs($y - $y0) <= $thresh, but the area where the expression is true is a square on the latitude/longitude grid. You could also use the Euclidean (L2) distance, i.e. sqrt(($x - $x0)**2 + ($y - $y0)**2) <= $thresh, which designates a circle with radius $thresh around the point ($x0, $y0).
On a very small scale, you can ignore the fact that the latitude and longitude grid describes a spheregeoid instead of a flat area and keep the assumptions above (about the square and the circle). If you are truly interested, you can find out the coordinates of the corners of the garage and check if the point falls inside the polygon described by those coordinates.
By the way, is your GPS precise enough to position your car when inside the garage?
In reply to Re: Check whether two numbers are within a range
by Anonymous Monk
in thread Check whether two numbers are within a range
by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |