From e7352dddc925512e4c6b0957ac4847a30fab968a Mon Sep 17 00:00:00 2001
From: Anton Kudryashov <qubabox@mail.ru>
Date: Mon, 21 Nov 2016 15:32:32 +0300
Subject: [PATCH] added coordinate methods for matrix

---
 WindStressPRM/Utils/Matrix.cs | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/WindStressPRM/Utils/Matrix.cs b/WindStressPRM/Utils/Matrix.cs
index 494d4a4..1019fd7 100644
--- a/WindStressPRM/Utils/Matrix.cs
+++ b/WindStressPRM/Utils/Matrix.cs
@@ -8,7 +8,19 @@ namespace WindStressPRM
     /// </summary>
     /// <typeparam name="T"></typeparam>
     public class Matrix<T>
-    {
+    {   
+        /// <summary>
+        /// origin coordinates of matrix. This must be top left corner
+        /// </summary>
+        public Coordinate Origin { get; set; }
+        /// <summary>
+        /// get coordinate of cell at index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        public Coordinate CoordinateAt(Index index) {
+            return new Coordinate(Origin.X + index.Row*Size.Width, Origin.Y - index.Col*Size.Height);
+        }
         /// <summary>
         /// AffineCoefficients for matrix from raster projection
         /// </summary>
-- 
GitLab