plane maths, still needs work