class MyPoint { float x, y; // members of class //Constructor MyPoint(float xin, float yin){ x = xin; y = yin; } //Move void move(float xoff, float yoff){ x += xoff; y += yoff; } //Rotate void rotate(float angle, MyPoint ref){ float cosa, sina; cosa = cos(radians(angle)); sina = sin(radians(angle)); float newx = (x-ref.x) * cosa - (y-ref.y) * sina + ref.x; float newy = (y-ref.y) * cosa + (x-ref.x) * sina + ref.y; x = newx; y = newy; } //Scale void scale(float xs, float ys, MyPoint ref){ x = (x-ref.x)*xs + ref.x; y = (y-ref.y)*ys + ref.y; } }