Find the minimum distance from a point to a line (this will be a vector perpendicular to the line). The actual calculation, where P0 is the first point of the road segment, v is the vector of the road segment, w is the vector from P0 to the point in question. You will need to iterate over each edge in the polyline. If the distance is less than the width of this segment, then this is an "on" road.
d = |v x w| / |v|
Angles can be complex depending on whether you are processing them rounded (constant radius) or angular.
source
share