# How to find distance between two points

Status
Not open for further replies.

#### hgphtgi

##### Banned

this is the derivation of the distance equation between two cells for hexagon type, please help me to get the distance between two cells for triangle and square cells

tnx bro's

#### Attachments

• QQQQQQQQQQQQQQ.JPG
37.4 KB · Views: 66

#### albbg

Sorry, but I didn't clearly understand your question. Do you want to calculate the distance between the center of two cells given what ?

#### hgphtgi

##### Banned
Tnxxxx for ur answer.this is what i mean

#### Attachments

• QQQQQQQQQQQQQQ.JPG
29.7 KB · Views: 45
• 111111111111.JPG
27.6 KB · Views: 45

#### _Eduardo_

##### Full Member level 5
It's the same result. just shift the vector D to the nearest vertex.

#### hgphtgi

##### Banned
tnxxxxxxx for replay

i think its not same because the angle is different.

#### _Eduardo_

##### Full Member level 5
i think its not same because the angle is different.
You are right, in the last image is best viewed.

The formula remains unchanged.
You just measure the coordinates u,v in height of triangles. And taking into account that the height each triangle is 1/2 and the center of the triangle is at h/3 = 1/6.

u = 1/6+1/2+1/2+1/2 = 5/3
v = 1/2+1/6 = 2/3
D = sqrt(25+4+10)/3 = sqrt(39)/3

#### Attachments

• Clipboard-3.jpg
69 KB · Views: 34
Last edited:

#### hgphtgi

##### Banned
tnx bro _Eduardo_ for ur answer

ur answer is brilliant and its Persuade. However i would the mathematical equation for D in general not for a specific example. PLZ

really i can't hardly express how glad i am.

i appreciate ur help bro

#### _Eduardo_

##### Full Member level 5
However i would the mathematical equation for D in general not for a specific example.

I do not understand what your problem.

The general formula is that you put in your first message.
The only secret is the computation of u and v according to where in the triangle are the start and end points.

Depends what your data are given, something that we still not know.

If the data are [u1, v1] and [u2, v2], just apply the fornula.

But if the data are the centers of the triangles, you must count the number that separates in each direction, including the fraction of height (h/3 or 2h/3 ; h: height of the triangle).

#### hgphtgi

##### Banned
hi bro _Eduardo_ tnx toooooo much gentleman.

ur answer now is full and clear for me tnx to much BUT how u got h/3, 2h/3 and the height each triangle is 1/2 ??

regards

#### _Eduardo_

##### Full Member level 5
In your first message, the distance between the hexagon centers is 1 ==> then height of each triangle is 1/2.

The center of every equilateral triangle is at 1/3rd of the height.

Status
Not open for further replies.