We generalize Ripley’s K function to get a new function, M, to characterize the spatial structure of a point pattern relatively to another one. We show that this new approach is pertinent in ecology when space is not homogenous and the size of objects matters. We present how to use the function and test the data against the null hypothesis of independence between points. In a tropical tree data set we detect intraspecific aggregation and interspecific competition.