goal to optimize java geometry equations in old project