More borrowed math.
This is based off the other project but you don't need to go to forkphorus this one is a lot less laggy.