I've been told chatGPT did not actually give me the TERCOM algorithm, but some other wayfinding algorithm missile guidance might use. But it's close enough that I'm not really comfortable sharing it in case this is somehow considered export controlled code.