MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: How to identify "intersections" between to data sets?

  • To: mathgroup at
  • Subject: [mg69214] RE: [mg69181] How to identify "intersections" between to data sets?
  • From: "David Park" <djmp at>
  • Date: Fri, 1 Sep 2006 18:41:28 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


Use the SameTest option in Intersection.

set1 = {{1.01, 5}, {2.1, 4}, {4.3, 4}};
set2 = {{1.02, 4}, {3, 8}, {4.305, 8}};

Intersection[set1, set2,
  SameTest -> (Abs[Part[#1, 1] - Part[#2, 1]] < 0.05 &)]
{{1.01, 5}, {4.3, 4}}

Look up Function in Help for an explanation of pure functions.

David Park
djmp at

From: Doug Lundin [mailto:dlundin at]
To: mathgroup at


I am working on a project with my son and, essentially, we have two data
sets with discrete points. These data sets intersect at various points.
Without fitting a line to the data, is there a way to determine these
intersections? I've already considered set intersection but that won't work
because the x-axis datum do not match exactly.

For example,
Set1 {{1.01,5},{2.1,4},{4.3,4}}
Set2 {{1.02,4},{3,8},{4.305,8})

I would like to be able to identify x=1.01 and x=4.3 as matches.



  • Prev by Date: Re: ReplaceAll (/.)
  • Next by Date: Re: ReplaceAll (/.)
  • Previous by thread: Re: How to identify "intersections" between to data sets?
  • Next by thread: ReplaceAll (/.)