moved Cartesian2D class to separate file