It should be noted RTCW / W:ET had a different kind of simple flare testing but that's GPL v3
If you understand the algorithm, why don't you write your own implementation? GPL is a copyright license so only the code itself (the text) is protected from copying, but not the underlying algorithm; you have to acquire a patent to protect an algorithm.
So you can't copy&paste parts of the RTCW/W:ET code, but you're absolutely allowed to write an own implementation copying its functionality. Linux for instance copies all Unix functionality but none of the Unix code, you couldn't legally do that if the Unix copyrights protected the functionality/algorithms instead of the code itself.