PDA

View Full Version : 2d array - parallel lines


Posolvski
04-25-2010, 10:37 AM
Hey i was wondering how i can definite the maximum number on every line which is parallel to the main diagonal of a 2d array ? I mean if somebody can help me with the algorithm of this problem . thanks .

BrickInTheWall
04-25-2010, 02:53 PM
I'm not sure what you mean. If you could draw an image of what you mean then maybe we can help you.

If you want to check if two lines are parellel, you can check if they are linearly dependent. You could also use the dot product. If you want, you can also calculate the determinant before hand. If it is not 0 then you don't need to use the other two methods. This might be faster if you have to check a lot of lines. If the determinant is 0, then they might be parallel and you can make the check. I'm sure there are a bunch of people who have already uploaded code for these mathematical procedures, so search the net incase this is what you need. If this was what you mean, then thats all the info I can give you right now.

Posolvski
04-25-2010, 05:19 PM
Hi thanks for the advices, I know that if the lines are equal to the rows than i can define the rank of the matrix .Hey i tried to upload the picture here but the system wants url , the picture is on my pc isnt into the net .