really didn't plan on writing this much math code, but I really want something simpler than a full general purpose math library