enable 2-dimensional operation when setting z=1
simple C++ example