# Find Euclidean distance based on cell size [closed]

Usually, Euclidean distance is defined as `squareroot((x1 - x2)^2 - (y1-y2)^2)` but, instead of having `x` and `y` values you have a cell size of `20`.

How can to calculate the Euclidean distance between the yellow boxes?

Further context:

• Do you know the relative position of the cells i.e. (0,0 and 4,1)? Mar 14 at 0:20
• Are the cells always in the same relative position? Otherwise it seems like the task is to calculate the distance between two unknown locations, which seems tricky. Mar 14 at 0:33
• In this specific case, given cell size 20 and measuring distance to/from the centre of the cells: x=20 y=60 so D= 63.245. This is a specific answer, to solve for other cases we need to know the relative position of the cells. a formula in that case would be: d = √((cellsize(cell2y-cell1y))²+(cellsize(cell2x-cell1x))²) i.e. d = √(4000 ) = 63.245 Mar 14 at 1:21
• Jusr because cell size is fixed doesn't mean that there is no Y component. It just means that X and Y are multiples of some constant w. This is more pure math than a GIS problem. Mar 14 at 11:12

``````x=20 y=60. Therefore: d=63.245
``````d = √( ( cellsize(cell2y-cell1y) )²+( cellsize(cell2x-cell1x) )² )