diff options
author | karishmarajput <karrajput3948@gmail.com> | 2021-10-26 10:50:47 +0530 |
---|---|---|
committer | karishmarajput <karrajput3948@gmail.com> | 2021-10-26 10:50:47 +0530 |
commit | 985820dbe4d8e414d6ceeb3811580dc8f796a34f (patch) | |
tree | 73355f876126f2f9fde8c2dac24c58dd9c0267ce /src/algorithms/2d-transformations | |
parent | 1e32d683ea9006617fc0d69270d6d501773564d6 (diff) | |
parent | 65723c9aeea6ff018f9dd9f464a38366e453a936 (diff) | |
download | dorado-985820dbe4d8e414d6ceeb3811580dc8f796a34f.tar.gz |
Merge branch 'master' of https://github.com/andinus/dorado
Diffstat (limited to 'src/algorithms/2d-transformations')
-rw-r--r-- | src/algorithms/2d-transformations/Scaling.svelte | 2 | ||||
-rw-r--r-- | src/algorithms/2d-transformations/Translation.svelte | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/algorithms/2d-transformations/Scaling.svelte b/src/algorithms/2d-transformations/Scaling.svelte index 9f17fd1..a08d5ce 100644 --- a/src/algorithms/2d-transformations/Scaling.svelte +++ b/src/algorithms/2d-transformations/Scaling.svelte @@ -32,7 +32,7 @@ } function solve() { - let scale_mat = [[scale_factor.x, 0], [0, scale_factor.y]]; + const scale_mat = [[scale_factor.x, 0], [0, scale_factor.y]]; scaled_points = [[], []]; // Deep copy. diff --git a/src/algorithms/2d-transformations/Translation.svelte b/src/algorithms/2d-transformations/Translation.svelte index 1fff3e9..4ae0ef7 100644 --- a/src/algorithms/2d-transformations/Translation.svelte +++ b/src/algorithms/2d-transformations/Translation.svelte @@ -23,13 +23,9 @@ points = points.filter(item => item.id !== Number(id)); } - let pointsArray = {x: [], y: []}; - let translatedPointsArray = {x: [], y: []}; - function translatePoints() { - // Reset values. - pointsArray = {x: [], y: []}; - translatedPointsArray = {x: [], y: []} + let pointsArray = {x: [], y: []}; + let translatedPointsArray = {x: [], y: []}; // Store the points in a matrix like array. for (const point of points) { |