Intersecting lines in sectors of a circle.

91 Views Asked by At

Good day everyone,

I'm trying to simulate a Laser Range Finder (LRF for short) in a corridor environment. I'm including a small fast sketch I did of this. I can't upload images yet, so I include just the link: LRF Detection and corridor environment Suppose it's better drawn.


         
          (Image added by J.O'Rourke.)


In this case, I have the LRF with its center and radius r. The detection range is given by alpha. LRF works with beam endpoints, therefore we have that the range is divided in sectors, being each line n the detection range and beta the angle between each beam endpoint.

Now we place the LRF in the corridor. The walls of it will be separated by a distance x, and the walls are parallel to each other (not so well drawn). Each beam endpoint (bep for short) that intersects the wall returns a distance smaller than the radius. If the bep doesn't intersect with the wall, then it returns a null value. This intersections are the orange dots you can find along the green bep.

In this case, I have 2 task I'd like to accomplish:

  1. To check which bep are returning a distance once the corridor is detected, given the case that we count the bep from 0:n from left to right.
  2. To count how many intersections points we have.
    • For this I was thinking I could split the bep in 2 and count per side of the scanner to compare which side is having more detection.

This should be true no matter the direction of the central bep of the scanner or the rotation of the corridor environment, which at the end, would be the same problem (shown in the lower image).

I'm trying to find a mathematical way to describe and count this tasks.

Thank you so much for help!