var JSX = {};
(function () {

/**
 * copies the implementations from source interface to target
 */
function $__jsx_merge_interface(target, source) {
	for (var k in source.prototype)
		if (source.prototype.hasOwnProperty(k))
			target.prototype[k] = source.prototype[k];
}

/**
 * defers the initialization of the property
 */
function $__jsx_lazy_init(obj, prop, func) {
	function reset(obj, prop, value) {
		delete obj[prop];
		obj[prop] = value;
		return value;
	}

	Object.defineProperty(obj, prop, {
		get: function () {
			return reset(obj, prop, func());
		},
		set: function (v) {
			reset(obj, prop, v);
		},
		enumerable: true,
		configurable: true
	});
}

/**
 * sideeffect().a /= b
 */
function $__jsx_div_assign(obj, prop, divisor) {
	return obj[prop] = (obj[prop] / divisor) | 0;
}

/*
 * global functions called by JSX
 * (enamed so that they do not conflict with local variable names)
 */
var $__jsx_parseInt = parseInt;
var $__jsx_parseFloat = parseFloat;
var $__jsx_isNaN = isNaN;
var $__jsx_isFinite = isFinite;

var $__jsx_encodeURIComponent = encodeURIComponent;
var $__jsx_decodeURIComponent = decodeURIComponent;
var $__jsx_encodeURI = encodeURI;
var $__jsx_decodeURI = decodeURI;

var $__jsx_ObjectToString = Object.prototype.toString;
var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;

/*
 * profiler object, initialized afterwards
 */
function $__jsx_profiler() {
}

/*
 * public interface to JSX code
 */
JSX.require = function (path) {
	var m = $__jsx_classMap[path];
	return m !== undefined ? m : null;
};

JSX.profilerIsRunning = function () {
	return $__jsx_profiler.getResults != null;
};

JSX.getProfileResults = function () {
	return ($__jsx_profiler.getResults || function () { return {}; })();
};

JSX.postProfileResults = function (url) {
	if ($__jsx_profiler.postResults == null)
		throw new Error("profiler has not been turned on");
	return $__jsx_profiler.postResults(url);
};
/**
 * class Point extends Object
 * @constructor
 */
function Point() {
}

Point.prototype = new Object;
/**
 * @constructor
 * @param {!number} x
 * @param {!number} y
 */
function Point$NN(x, y) {
	this.x = x;
	this.y = y;
};

Point$NN.prototype = new Point;

/**
 * @constructor
 * @param {Array.<undefined|!number>} a
 */
function Point$AN(a) {
	this.x = a[0];
	this.y = a[1];
};

Point$AN.prototype = new Point;

/**
 * @constructor
 * @param {Point} p
 */
function Point$LPoint$(p) {
	this.x = p.x;
	this.y = p.y;
};

Point$LPoint$.prototype = new Point;

/**
 * class Matrix extends Object
 * @constructor
 */
function Matrix() {
}

Matrix.prototype = new Object;
/**
 * @constructor
 * @param {!number} m11
 * @param {!number} m12
 * @param {!number} m13
 * @param {!number} m21
 * @param {!number} m22
 * @param {!number} m23
 */
function Matrix$NNNNNN(m11, m12, m13, m21, m22, m23) {
	this.m11 = m11;
	this.m12 = m12;
	this.m13 = m13;
	this.m21 = m21;
	this.m22 = m22;
	this.m23 = m23;
};

Matrix$NNNNNN.prototype = new Matrix;

/**
 * @param {Point} pt
 * @return {Point}
 */
Matrix.prototype.transform$LPoint$ = function (pt) {
	return new Point$NN(this.m11 * pt.x + this.m12 * pt.y + this.m13, this.m21 * pt.x + this.m13 * pt.y + this.m23);
};

/**
 * @param {Array.<undefined|Point>} polygon
 * @return {Array.<undefined|Point>}
 */
Matrix.prototype.transform$ALPoint$ = function (polygon) {
	/** @type {Array.<undefined|Point>} */
	var ret;
	/** @type {!number} */
	var i;
	/** @type {Point} */
	var pt$0;
	ret = new Array(polygon.length);
	for (i = 0; i < ret.length; ++ i) {
		pt$0 = polygon[i];
		ret[i] = new Point$NN(this.m11 * pt$0.x + this.m12 * pt$0.y + this.m13, this.m21 * pt$0.x + this.m13 * pt$0.y + this.m23);
	}
	return ret;
};

var $__jsx_classMap = {
	"tmp/polygon.jsx": {
		Point: Point,
		Point$NN: Point$NN,
		Point$AN: Point$AN,
		Point$LPoint$: Point$LPoint$,
		Matrix: Matrix,
		Matrix$NNNNNN: Matrix$NNNNNN
	}
};

console.log(new Matrix$NNNNNN(1,0,0,2,0,0).transform$ALPoint$([new Point$NN(1,2),new Point$NN(3,4)]));

})();
