I have programmed a triangle-triangle intersection algorithm, which have I have successfully tested for all distinctly different situations I could think of. I did this by manually inspecting all these situations using an online visualisation tool.

To be certain there are no bugs in the code, I would now like to test more comprehensively. My plan is to run an automated test for every possible configuration in a 100x100x100 grid in 3D space. Thus I either need a list with these coordinates and whether there is an intersection or not, or I need another algorithm that I can trust to produce the correct results.


  • Could add some images to show exactly what you are looking for – PDHide Jun 1 at 15:12

I think you need 2 things:

  • a list of coordinates, that's your input you're gonna feed into your algorithm and into some good oracle
  • another algorithm, an oracle, that you can trust it solves the problem successfully

The second point might be a bit more complicated, but my quick search revealed there might be some implementation freely lying around on stackoverflow for instance, or another algorithm that's posted in the same stackoverflow discussion under one of the posts.

I'd get one of such algorithms and feed the test data both to your implementation and to this 3rd party algorithm and check whether or not the results are the same.

| improve this answer | |
  • 1
    This does make me wonder why someone would roll their own implementation - i.e if you're going to trust another implementation as your source of truth for an A/B type of test, why wouldn't you just use that implementation? – ernie Jun 1 at 17:22
  • @ernie: people constantly reinvent the wheel, that's why we have so many developers in the first place :D – pavelsaman Jun 1 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.