# How to calculate distance between points in DBSCAN matrix data? [closed]

I'm making a simple C implementation of DBSCAN following his pseudocode.

If I well underand how DBSCAN works, I may represent my set of N elements (each with M features) with a NxM matrix.

When it comes to write regionQuery(), I need calculate the distance between two points: if I was in an Euclidean plane (let's say in a Nx2 matrix), I'd use this formula; since I'm in a M-dimensional space, what is the proper formula?

## closed as unclear what you're asking by Anony-Mousse, gung♦, whuber♦Feb 6 '16 at 16:27

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Please paste in whatever context is necessary to understand & answer your question. We want this thread to remain valuable even if the link goes dead. – gung Feb 6 '16 at 15:00

When coming to compute the distance between two specific points, you use the M features. As @Archie wrote, you have the formula at the same page. Note that $p_{i}$ is the i'th feature of the point p.