Matrix_and_Polygon.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #include "Matrix.h"
  19. #include "Polygon.h"
  20. autoPolygon Matrix_to_Polygon (Matrix me);
  21. /*
  22. Function:
  23. create a Polygon from a Matrix.
  24. Failures:
  25. my ny != 2 && my nx != 2; // Matrix must have exactly 2 rows or columns.
  26. Out of memory.
  27. Postconditions:
  28. thy numberOfPoints == my nx;
  29. if (my ny == 2) {
  30. thy x [...] == my z [1] [...];
  31. thy y [...] == my z [2] [...];
  32. } else {
  33. thy x [...] == my z [...] [1];
  34. thy y [...] == my z [...] [2];
  35. }
  36. */
  37. autoMatrix Polygon_to_Matrix (Polygon me);
  38. /*
  39. Function:
  40. create a Matrix from a Polygon.
  41. Postconditions:
  42. thy xmin xmax nx dx x1 == 1 my numberOfPoints my numberOfPoints 1 1;
  43. thy ymin ymax ny dy y1 == 1 2 2 1 1;
  44. thy z [1] [...] == my x [...];
  45. thy z [2] [...] == my y [...];
  46. */
  47. /* End of file Matrix_and_Polygon.h */