class to define and manipulate 2D/3D cartesian coordinate systems in javascript