|
-
Sep 24th, 2004, 08:18 AM
#1
Thread Starter
Stuck in the 80s
Length of Diag in Grid?
Is there an easy method for finding the length of a diagnol line in a grid. Say, if I have:
Code:
x x x x x x x x x x
x x x x x x x x x x
x x x x x x x x x x
x x x x x x x x x x
x x x x x x x x x x
x x x x x x x x x x
And I know that x is 6 and y is 4 (bottom x). How could I find the length of any diagnol line, no matter where it starts?
-
Sep 24th, 2004, 08:53 AM
#2
Fanatic Member
a^2 + b^2 = c^2
Or...
Length = sqr(xdif^2 + ydif^2)
Don't pay attention to this signature, it's contradictory.
-
Sep 25th, 2004, 07:13 AM
#3
Or are you talking about the number of X's in a diagonal line in your grid?
Max (XDiff; YDiff)
Onlyalid if lines are either horizontal, vertical or at a 45 degree to that.
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
Sep 25th, 2004, 06:26 PM
#4
Fanatic Member
Are your lines composed of X's or are they composed of the endpoints of the line?
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Sep 25th, 2004, 09:25 PM
#5
Thread Starter
Stuck in the 80s
They're composed of X's. It's for a crossword puzzle, so I was trying to figure out how many letters could be in that line of spots.
But...I figured out my teacher wants us to do this a different way, so I don't really need to know anymore.
-
Sep 27th, 2004, 11:12 AM
#6
Fanatic Member
So is this resolved then?
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Sep 27th, 2004, 12:35 PM
#7
Thread Starter
Stuck in the 80s
Originally posted by Darkwraith
So is this resolved then?
Yes and no. I don't need the answer anymore, but I'm still curious about how it can be accomplished.
-
Sep 29th, 2004, 12:19 AM
#8
If it's for a crossword, you're counting the "x" or the letters.
So use the max(XDiff,YDiff), or more precise max(Xdiff+1;YDiff+1).
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|