How to find distance between two points

Status
Not open for further replies.

hgphtgi

Banned
Joined
Jul 23, 2009
Messages
15
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
0
please help me to find the distance between two points

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

i appreciate your helpful

tnx bro's
 

Attachments

  • QQQQQQQQQQQQQQ.JPG
    37.4 KB · Views: 191

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

Tnxxxx for ur answer.this is what i mean
 

Attachments

  • QQQQQQQQQQQQQQ.JPG
    29.7 KB · Views: 170
  • 111111111111.JPG
    27.6 KB · Views: 166

It's the same result. just shift the vector D to the nearest vertex.
 

tnxxxxxxx for replay

i think its not same because the angle is different.
 

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: 162
Last edited:

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
 

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).
 

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
 

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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…