From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-12-2019 11:59 PM
Please help me, How can I find the intersection points (x,y) in the given figure.
please give some suggestions.
09-13-2019 02:13 AM - edited 09-13-2019 02:16 AM
Hi Rajesh,
I guess you want to find the point [1, 2] as "intersection".
From what you have shown:
(When you want to calculate points where lines cross: this is simple mathematics you should have learned in school. Apply math…)
09-13-2019 02:39 AM
Your intersection is actually at one of the actual points and thus is a set of coordinates that occurs twice. Given this information, the solution us trivial. (In addition, the start and end points overlap to close the curve, so keep that in mind)
Programming is typically more interesting and should work with any finite set of arbitrary line segments. As a first step, generate two random lines defined by two points each and see if they cross (or touch), and if so where. Solve the general problem!
09-13-2019 05:53 AM
Thanks, GerdW
But I have some doubts
Here it is clearly visible that where the line intersects so you suggest search for the intersect element. But if a graph is complicated with 10000 data-set then this might not work as it may be difficult to locate the point exactly
Suppose I need to calculate this intersection with online data then what I can do.
Thank you again.
09-13-2019 06:08 AM
Hi Rajesh,
@Rajesh10 wrote:
Suppose I need to calculate this intersection with online data then what I can do.
Did you read Christians and my answer?
Apply basic math!
09-13-2019 06:10 AM
Thanks altenbach
But the whole plot is a single line
09-13-2019 06:53 AM
@Rajesh10 wrote:
Thanks altenbach
But the whole plot is a single line
No it isn't. It is a bunch of line segments between a series of points that are defined by an X array and Y array.
What you have is not really a LabVIEW problem. At least not yet. It is a Math/Geometry problem.
How would you find the answer if all you had was pencil and paper?
09-13-2019 10:13 AM
Once you solve the problem I gave you earlier, make it into a subVI, then go inspect every line segment in order and see if it touches any line segment you already looked at. You also need to deal with special cases (e.g. two lines overlap, two segments are identical, one point touched another line but the lines do not cross, one long line crosses several other segments, etc.).