| 1 | /* Matrix_and_Polygon.h |
| 2 | * |
| 3 | * Copyright (C) 1992-2011,2015 Paul Boersma |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 | * See the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #include "Matrix.h" |
| 20 | #include "Polygon.h" |
| 21 | |
| 22 | autoPolygon Matrix_to_Polygon (Matrix me); |
| 23 | /* |
| 24 | Function: |
| 25 | create a Polygon from a Matrix. |
| 26 | Failures: |
| 27 | my ny != 2 && my nx != 2; // Matrix must have exactly 2 rows or columns. |
| 28 | Out of memory. |
| 29 | Postconditions: |
| 30 | thy numberOfPoints == my nx; |
| 31 | if (my ny == 2) { |
| 32 | thy x [...] == my z [1] [...]; |
| 33 | thy y [...] == my z [2] [...]; |
| 34 | } else { |
| 35 | thy x [...] == my z [...] [1]; |
| 36 | thy y [...] == my z [...] [2]; |
| 37 | } |
| 38 | */ |
| 39 | |
| 40 | autoMatrix Polygon_to_Matrix (Polygon me); |
| 41 | /* |
| 42 | Function: |
| 43 | create a Matrix from a Polygon. |
| 44 | Postconditions: |
| 45 | thy xmin xmax nx dx x1 == 1 my numberOfPoints my numberOfPoints 1 1; |
| 46 | thy ymin ymax ny dy y1 == 1 2 2 1 1; |
| 47 | thy z [1] [...] == my x [...]; |
| 48 | thy z [2] [...] == my y [...]; |
| 49 | */ |
| 50 | |
| 51 | /* End of file Matrix_and_Polygon.h */ |