Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2007-09-26 08:40:51

Philip
Guest

A geometric geofence

I need to be alerted when a vehicle crosses a line. The line is defined by start and end points in terms of spatial coordinates (x,y) e.g. start of line x=2662150 (east), y=6494900 (north) end of line x=2662158 (east), y=6494895 (north)- these are actually New Zealand map grid coordinates - but the principle is the same in any coordinate system.
We always know that the coordinates are positive.

The vehicle carries a GPS and so always knows its own x,y position. The challenge is to construct an algorithm that continuously monitors the position and triggers an alert when the vehicle crosses the line (or an extension of the line) - within a reasonable distance beyond the line.

My thinking so far is to set one of the points to the origin and then set the y axis so that it follows the line. If I can translate the x,y of the moving vehicle into this (new) coordinate system then the trigger would simply fire when the x coordinate changes from positive to negative (or vice versa) - i.e. crosses the (new) y axis in either direction. I think that this requires a translation to polar coordinates so that the angle of axis rotation can be calculated, but despite much sketching and figuring I can't figure it out

Any help or pointers would be appreciated

#2 2007-09-26 23:26:02

mathsyperson
Moderator
Registered: 2005-06-22
Posts: 4,900

Re: A geometric geofence

The equation of your line is 5x + 8y = 65269950.

If you don't want to be NE of the line, then the vehicle should trigger an alert when 5x + 8y > 65269950, and if you don't want to be SW of the line, then the alert should trigger when 5x + 8y < 65269950.

I have no idea how I would start doing it your way though.


Why did the vector cross the road?
It wanted to be normal.

Offline

Board footer

Powered by FluxBB