RE: How to identify "intersections" between to data sets?
- To: mathgroup at smc.vnet.net
- Subject: [mg69214] RE: [mg69181] How to identify "intersections" between to data sets?
- From: "David Park" <djmp at earthlink.net>
- Date: Fri, 1 Sep 2006 18:41:28 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Doug, 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 earthlink.net http://home.earthlink.net/~djmp/ From: Doug Lundin [mailto:dlundin at aol.com] To: mathgroup at smc.vnet.net Hello, 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. Thoughts? Thanks! Doug