diff options
author | Andinus <andinus@nand.sh> | 2021-10-26 05:51:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 05:51:44 +0000 |
commit | cf5508aec851bb764c372d2b347d6adb95e7e8ec (patch) | |
tree | e847f5f9b2fcfa1e718e8e84e8519d4589a22718 | |
parent | 65723c9aeea6ff018f9dd9f464a38366e453a936 (diff) | |
parent | 68f660b33890ab8fc9db1552ae71dff0dd9c2c45 (diff) | |
download | dorado-cf5508aec851bb764c372d2b347d6adb95e7e8ec.tar.gz |
Merge pull request #5 from karishmarajput/master
added translated points table
-rw-r--r-- | src/algorithms/2d-transformations/Translation.svelte | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/algorithms/2d-transformations/Translation.svelte b/src/algorithms/2d-transformations/Translation.svelte index a910cc6..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) { @@ -104,6 +107,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> |