From ddea5bc7050ecae2081cb7ed7a7c2ee206a53e8f Mon Sep 17 00:00:00 2001
From: karishmarajput <karrajput3948@gmail.com>
Date: Tue, 26 Oct 2021 10:40:16 +0530
Subject: translated points table added

---
 src/algorithms/2d-transformations/Translation.svelte | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

(limited to 'src/algorithms/2d-transformations/Translation.svelte')

diff --git a/src/algorithms/2d-transformations/Translation.svelte b/src/algorithms/2d-transformations/Translation.svelte
index 9ce71da..1fff3e9 100644
--- a/src/algorithms/2d-transformations/Translation.svelte
+++ b/src/algorithms/2d-transformations/Translation.svelte
@@ -108,6 +108,24 @@
       {/each}
     </tbody>
   </table>
+  <h4>Translation Points</h4>
+  <table>
+    <thead>
+      <tr>
+       
+        <th>x</th>
+        <th>y</th>
+      </tr>
+    </thead>
+    <tbody>
+      {#each translatedPointsArray.x as _, i}
+        <tr>
+          <td>{translatedPointsArray.x[i]}</td>
+          <td>{translatedPointsArray.y[i]}</td>
+        </tr>
+      {/each}
+    </tbody>
+  </table>
 {/if}
 
 <div id="algoChart"></div>
-- 
cgit 1.4.1-2-gfad0


From 68f660b33890ab8fc9db1552ae71dff0dd9c2c45 Mon Sep 17 00:00:00 2001
From: karishmarajput <karrajput3948@gmail.com>
Date: Tue, 26 Oct 2021 11:18:51 +0530
Subject: Make translatedPointsArray global

---
 src/algorithms/2d-transformations/Translation.svelte | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/algorithms/2d-transformations/Translation.svelte')

diff --git a/src/algorithms/2d-transformations/Translation.svelte b/src/algorithms/2d-transformations/Translation.svelte
index 4ae0ef7..0416f2b 100644
--- a/src/algorithms/2d-transformations/Translation.svelte
+++ b/src/algorithms/2d-transformations/Translation.svelte
@@ -22,10 +22,13 @@
   function deletePoint(id) {
     points = points.filter(item => item.id !== Number(id));
   }
+let translatedPointsArray = {x: [], y: []};
 
   function translatePoints() {
+    // Reset values.
+    translatedPointsArray = {x: [], y: []};
+
     let pointsArray = {x: [], y: []};
-    let translatedPointsArray = {x: [], y: []};
 
     // Store the points in a matrix like array.
     for (const point of points) {
-- 
cgit 1.4.1-2-gfad0

