Calculate number of roads/lines a line crosses

  • Thread starter Rich2020
  • Start date
  • Tags
    Line
In summary, the speaker is seeking help with a tricky problem involving using Google maps to determine if a user has drawn a line over a road and how many roads it intersects with. They mention being able to use Pythagoras for a single road, but needing help with multiple roads. They are open to all suggestions.
  • #1
Rich2020
4
0
Hi guys,

I have a really tricky problem here and I'm hoping that there is a math guru here who can help.

The problem

Using Google maps, I need to allow a user to draw a line. This line can be in any direction and basically, I need to determine if the user has drawn the line over a road and if so, how many.

Below is an example:
The image doesn't seem to be showing so here is the link: http://postimg.org/image/iuj9e8jfj

With Google Directions service, I am able to get the nearest road of the dropped marker (markers indicated by arrow in image).

For a single road, I believe that I can do this with Pythagoras, but for multiple roads by brain starts to boil.

If anyone here could help, I'd really appreciate it. I appreciate it is pretty tough so I'm open to all suggestions.

Thanks!
 
Last edited by a moderator:
Mathematics news on Phys.org
  • #2
I really don't understand what you want to do. Do you want to calculate he number of roads the line is intersecting?
 
  • #3
adjacent said:
I really don't understand what you want to do. Do you want to calculate he number of roads the line is intersecting?

Yes, exactly that :)
 

1. How do you calculate the number of roads/lines a line crosses?

To calculate the number of roads/lines a line crosses, you can use the formula: n = (l - 1) * (l / 2), where n is the number of crossings and l is the number of lines in the diagram.

2. Why is it important to calculate the number of roads/lines a line crosses?

Calculating the number of roads/lines a line crosses is important because it helps in understanding the complexity of a diagram or network. It also helps in determining the shortest or most efficient route between two points.

3. What factors can affect the number of roads/lines a line crosses?

The number of roads/lines a line crosses can be affected by the density and arrangement of the lines, the type of intersection (e.g. T-junction, crossroads), and the presence of one-way streets or dead ends.

4. Can the number of roads/lines a line crosses be calculated for curved lines?

Yes, the formula for calculating the number of roads/lines a line crosses can also be applied to curved lines. However, it may be more complex as it would require taking into account the curve's radius and angle.

5. How can the number of roads/lines a line crosses be used in real-world applications?

The calculation of the number of roads/lines a line crosses can be used in various real-world applications such as urban planning, traffic management, and navigation systems. It can also be applied in computer science for routing algorithms and graph theory.

Similar threads

Replies
1
Views
828
Replies
4
Views
2K
  • General Math
Replies
16
Views
2K
  • General Discussion
Replies
16
Views
2K
Replies
73
Views
3K
  • Introductory Physics Homework Help
Replies
10
Views
509
Replies
4
Views
2K
  • Electromagnetism
Replies
4
Views
966
  • Introductory Physics Homework Help
Replies
3
Views
1K
Back
Top