Page **1** of **1**

### Intersection problem

Posted: **Wed Feb 06, 2019 5:00 am**

by **MagicBoy**

I want to define the points of intersection of a black & white graphic and a line.

The intersection function only returns "yes" or "no" if an intersection occurs.

I need to find the exact points that the intersection(s) occur.

Any ideas?

Thanks,

Geoff

### Re: Intersection problem

Posted: **Wed Feb 06, 2019 10:55 am**

by **bogs**

Well, mind you I only just woke up and aren't yet up to *thinking* level

so this may or may not make sense to you.

I would take the brute force method and do it in a repeat loop. You'll have all the points of both lines, shove them into 2 different variables, pick the variable of your preference, and then something like (psuedo code) -

Code: Select all

```
set the itemDelimiter to comma
repeat for each item x in var1
if x is among the items of var2 then put x into var3
end repeat
```

any coordinate from the graphic that is the same as a coordinate from the line should wind up in var3. Or I could just not be awake yet, like I said

### Re: Intersection problem

Posted: **Wed Feb 06, 2019 4:01 pm**

by **dunbarx**

Bogs is likely on the right track.

But what do you mean by a "black and white graphic"? A line is a graphic. Do you mean an image? And do you want to find the black pixels in the image that coincide with the points of a line graphic?

Craig Newman

### Re: Intersection problem

Posted: **Wed Feb 06, 2019 4:02 pm**

by **dunbarx**

Klaus et al...

I would move this to the beginners pane; it has nothing to do with new features.

Craig

### Re: Intersection problem

Posted: **Wed Feb 06, 2019 4:33 pm**

by **Klaus**

Hi Geoff,

welcome to the forum!

And Craig is correct, will move this thread now to the beginners section (Hint, Hint!).

Best

Klaus

P.S.

A little "Hello" or something will surely not hurt in the first posting...

### Re: Intersection problem

Posted: **Thu Feb 07, 2019 4:20 am**

by **capellan**

Hi Geoff,

Check the stacks posted in this other forum thread:

https://forums.livecode.com/viewtopic.php?f=10&t=32027
Al