10 X 10 grid and finding distances from multiple points...

  • Thread starter Thread starter brya6347
  • Start date Start date
B

brya6347

here is what i need help with...

this is a small example of what i need to do...

10 X 10 grid (x-y axis 0-10)

on the grid are 4 points (for example (2,3)(3,4)(5,5)(7,5))

i need to determine the distance of each point to each grid mark..for
example each point on the grid (0,0)(0,1)....(10,10) i need to find the
distance that point is to the all 4 points that are user defined.

i am trying to write a routine in VBA that will do this

it has been awhile since i tinkered with VBA so any help would be
greatly appreciated
 
This isnt a VBA solution, but maybe this will work for you...

Sounds like you need to apply the old pythagorean formula (a²+b²=c²)
make a table of every grid point (0,0)-(10,10)
0 0
0 1
0 2
.....
10 9
10 10 (121 rows of data)

then for each of your user defined points... caluculate the x-diff and the
y-diff, then plug them into the formula and solve for c.
=SQRT(x-diff²+y-diff²)

Hope that helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top