How to generate a set of connected line segment that when we randomly choose any two points and plus y feet above it, so they could mutually see each other?
1 view (last 30 days)
Show older comments
The question should be specified like this. I need to randomly generate a set of connected line segment. Any two points that is y feet above it could be connected without intersecting with the connected line segment.
Thanks. Your answer will help me a lot!
4 Comments
Answers (1)
Image Analyst
on 24 Feb 2014
OK. Point A and point B are on the thick zig zag line, and you have two points above them at (xa, ya+y), and at (xb, yb+y). A line could be drawn between those two points that may or may not intersect the zig zag, depending on what y is and what the zig zag does in between xa and xb.
But I'm not exactly sure what the question is. Do you want to know if the line intersects the zig zag or not? Do you want the height (y value) for all the points on a line connecting (xa, ya+y) to (xb, yb+y)?
3 Comments
Image Analyst
on 24 Feb 2014
Can't you just calculate the slope between then and then find the y value of the connecting line for each zig zag element location and see if the connecting line is always above? It's just simple algebra.
See Also
Categories
Find more on Smoothing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!