Note that there are some explanatory texts on larger screens.

plurals
  1. PORotating Multi-Dimensional Arrays
    primarykey
    data
    text
    <p>So I want to compare one 2-dimensional array with another 2-dimensional array (acctually portion of another larger 2-dimensional arrays). What I need to do is to compare the first array with the second, but I also need to compare it from multiple angles, rotating one of them if you will.</p> <p>I'm writing this in c++ and I'm using vectors (in case there is a specific algorithm or function for these that would help)</p> <p>Here's an example of what I need to be able to do with this:</p> <pre><code>Take this map: 0001000 0001000 0001000 0001111 0000000 Compare it to this (which means if 1 is road and 0 is grass, this would help me find 'turns' in the road): 010 110 000 Comparing it like that won't yield any results, BUT, if I rotate it to 180 degrees: 010 011 000 It fits. </code></pre> <p>More specifally I will compare a whole bunch of small arrays to the large array. I will not compare every location on the large array, only pick a location at random and a small array at random, rotate the small array to all 4 sides and see if they match. I will repeat this a few hundred times to find a decent sample of locations where a random selected sample of small maps compare positively to the large map.</p> <p>Basically... :)</p> <p>Atm I'm trying to figure it out, but I don't want to reinvent a wheel if I can help it.</p> <p>(UPDATE: Close to solving this! I realised that I acctually need to rotate the lesser grid 8 times, I need to match every mirror! UPDATE2: lol I solved it wtf. Will post as soon as I understand what the code acctually does, might as well. 5 AM I'm crazy like this!)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload