/* Matrix_and_Polygon.h */
/* Paul Boersma, November 7, 1995 */

#ifndef _Matrix_h_
	#include "Matrix.h"
#endif
#ifndef _Polygon_h_
	#include "Polygon.h"
#endif

Polygon Matrix_to_Polygon (I);
/*
	Function:
		create a Polygon from a Matrix; return NULL in case of failure.
	Failures:
		my ny != 2 && my nx != 2;   //  Matrix must have exactly 2 rows or columns.
		Out of memory.
	Postconditions:
		thy numberOfPoints == my nx;
		if (my ny == 2) {
			thy x [...] == my z [1] [...];
			thy y [...] == my z [2] [...];
		} else {
			thy x [...] == my z [...] [1];
			thy y [...] == my z [...] [2];
		}
*/

Matrix Polygon_to_Matrix (I);
/*
	Function:
		create a Matrix from a Polygon; return NULL if out of memory.
	Postconditions:
		thy xmin xmax nx dx x1 == 1 my numberOfPoints my numberOfPoints 1 1;
		thy ymin ymax ny dy y1 == 1 2 2 1 1;
		thy z [1] [...] == my x [...];
		thy z [2] [...] == my y [...];
*/

/* End of file Matrix_and_Polygon.h */
