well, that slope didn't work, i will need the grid to be diamond shaped. that in itself is quite the problem and is another request for help. i need to be able to find out both x,y coordinates of a diamond shaped grid using only 3 values - listed below.
this is how the grid would look in its entirety. the Xs are just line markers and give a spot to center location on. there are some blank spots, but don't worry about those. each x is a value of 1, increasing left to right and bottom to top.
CODE
x 1,4
x 1,3 2,4
x 1,2 2,3 3,4
x 1,1 2,2 3,3 4,4
x 2,1 3,2 4,3
x 3,1 4,2
x 4,1
x x x x x x x
now, you have to find the x,y coordinates using only three pieces of information.
x and y axis refer to the vertical(Y) and horizontal(X) lines of Xs
the individual Y and X-axis values
the sum of the Y and X-axis
the value of each column(X-axis value + 1)(as shown below)
CODE
5
4 6
3 5 7
2 4 6 8
3 5 7
4 6
5
i've found a method, after about half a weeks work. but i'm wondering if theres a better one i haven't discovered yet
ADDITION:
don't mind the messed up grids, i think you can get the point
ADDITION:
QUOTE(in_a_biskit @ Jun 27 2006, 03:28 AM)
Alternatively, you can try to use Euclid's Algorithm to find the greatest common divisor
d. Euclid's algorithm works at the speed of light, and looks like this:
Divide
a by
b and find the remainder
r[sub]1[/sub]. Then divide
b by
r[sub]1[/sub] and find the remainder
r[sub]2[/sub]. Divide
r[sub]1[/sub] by
r[sub]2[/sub] and find the remainder
r[sub]3[/sub], and so on. Continue until
r[sub]n[/sub] = 0, and then
r[sub]n-1[/sub] =
d, the lowest common denominator.
[codebox]Example: find the greatest common divisor of 138 and 96.
138 = 1*96 + 42 (i.e.
r[sub]1[/sub] = 42)
96 = 2*42 + 12
42 = 3*12 + 6
12 = 2*6 (+ 0)
So the greatest common divisor of 138 and 96 is 6.
So the ratio 138:96 in lowest terms is 138/6:96/6 = 23:16[/codebox]I will be very impressed with anyone who can put this in their map
[right][snapback]514212[/snapback][/right]
say 138 = A
say 96 = B
what happens if A happened to be lower than B? would you just switch them around?