implement a simple math library for 2D render.