# Self-path intersection

**URL:** <https://forum.kirupa.com/t/self-path-intersection/319854>\
**Category:** programming\
**Created:** [March 6, 2011, 10:49pm UTC](https://forum.kirupa.com/t/self-path-intersection/319854 "2011-03-06T22:49:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WhiteyMcWhite](https://avatars.discourse-cdn.com/v4/letter/w/91b2a8/32.png) [@WhiteyMcWhite](https://forum.kirupa.com/u/WhiteyMcWhite)\
**Post date:** [March 6, 2011, 10:49pm UTC](https://forum.kirupa.com/t/self-path-intersection/319854/1 "2011-03-06T22:49:10Z")

</div>

So I’m trying to figure out a way of finding the intersection of a path that loops around on itself. The best way to hold the path of an object would just keep an array of points to a certain length as it moves.

I’m looking to achieve something similar to the looping/collecting in NiGHTs, you can see what I mean in this video.

But I’m not sure how to tell whether the path as looped over itself or not, I can do it using calculus lol, but that would be way too slow and impractical. Even if I check each segment (point to point) for bisection, it seems like a lot of unneeded checking. I also, have no idea how to quickly find what’s inside of the “loop,” when the intersection is found. Anyone have any ideas or links that would help me out?
