From f9d89e46b2fd280697e38f3a7abe550babad4c88 Mon Sep 17 00:00:00 2001
From: Abhinav Mishra <149368945+CoderUzumaki@users.noreply.github.com>
Date: Fri, 24 May 2024 14:31:35 +0530
Subject: [PATCH 1/7] Create README.md
---
Calculators/3D-Distance-Calculator/README.md | 1 +
1 file changed, 1 insertion(+)
create mode 100644 Calculators/3D-Distance-Calculator/README.md
diff --git a/Calculators/3D-Distance-Calculator/README.md b/Calculators/3D-Distance-Calculator/README.md
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/Calculators/3D-Distance-Calculator/README.md
@@ -0,0 +1 @@
+
From 3a7d329c7f8b70498c6511dd35f9e85cd0f12223 Mon Sep 17 00:00:00 2001
From: Abhinav Mishra <149368945+CoderUzumaki@users.noreply.github.com>
Date: Fri, 24 May 2024 14:32:08 +0530
Subject: [PATCH 2/7] Add files via upload
---
Calculators/3D-Distance-Calculator/index.html | 53 ++++++++++++++
Calculators/3D-Distance-Calculator/script.js | 21 ++++++
Calculators/3D-Distance-Calculator/style.css | 73 +++++++++++++++++++
3 files changed, 147 insertions(+)
create mode 100644 Calculators/3D-Distance-Calculator/index.html
create mode 100644 Calculators/3D-Distance-Calculator/script.js
create mode 100644 Calculators/3D-Distance-Calculator/style.css
diff --git a/Calculators/3D-Distance-Calculator/index.html b/Calculators/3D-Distance-Calculator/index.html
new file mode 100644
index 000000000..8e30ffd28
--- /dev/null
+++ b/Calculators/3D-Distance-Calculator/index.html
@@ -0,0 +1,53 @@
+
+
+
+
+
+ 3D Distance Calculator
+
+
+
+
+
+
+
+
+ |AB| =
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Calculators/3D-Distance-Calculator/script.js b/Calculators/3D-Distance-Calculator/script.js
new file mode 100644
index 000000000..6356f1139
--- /dev/null
+++ b/Calculators/3D-Distance-Calculator/script.js
@@ -0,0 +1,21 @@
+function calculate() {
+ // Get input values
+ var x1 = parseFloat(document.getElementById('x1').value);
+ var y1 = parseFloat(document.getElementById('y1').value);
+ var z1 = parseFloat(document.getElementById('z1').value);
+ var x2 = parseFloat(document.getElementById('x2').value);
+ var y2 = parseFloat(document.getElementById('y2').value);
+ var z2 = parseFloat(document.getElementById('z2').value);
+
+ // Check if input values are valid
+ if (isNaN(x1) || isNaN(y1) || isNaN(z1) || isNaN(x2) || isNaN(y2) || isNaN(z2)) {
+ document.getElementById('result').innerHTML = 'Please enter valid numbers for both points.';
+ return;
+ }
+
+ // Calculate distance
+ var distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2));
+
+ // Display the result
+ document.getElementsByClassName('display')[0].innerHTML = '|AB| = ' + distance.toFixed(3);
+}
\ No newline at end of file
diff --git a/Calculators/3D-Distance-Calculator/style.css b/Calculators/3D-Distance-Calculator/style.css
new file mode 100644
index 000000000..f285163b7
--- /dev/null
+++ b/Calculators/3D-Distance-Calculator/style.css
@@ -0,0 +1,73 @@
+@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
+
+*{
+ margin: 0;
+ padding: 0;
+ font-family: "Poppins", sans-serif;
+ font-weight: 400;
+ box-sizing: border-box;
+}
+
+.container{
+ width: 100%;
+ height: 100dvh;
+ background-color: #e3f9ff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.calc{
+ padding: 20px;
+ border-radius: 10px;
+ background-color: #3a4452;
+ color: white;
+ display: flex;
+ flex-direction: column;
+ gap: 20px;
+ align-items: center;
+ justify-content: center;
+}
+
+.display{
+ height: 50px;
+ width: 250px;
+ border-radius: 10px;
+ margin: 10px 0 0 0;
+ background: #fff;
+ color: black;
+}
+
+.display{
+ font-size: 20px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 5px;
+}
+
+form{
+ display: flex;
+ gap: 30px;
+ margin: 20px 0;
+}
+form input{
+ border-radius: 10px;
+ height: 30px;
+ width: 150px;
+ margin: 5px 5px;
+ padding: 5px;
+ cursor: pointer;
+ font-size:20px;
+}
+
+button{
+ height: 50px;
+ width: 150px;
+ border: 0;
+ margin: 10px;
+ box-shadow: -8px -8px 15px rgba(255, 255, 255, 0.1), 5px 5px 15px rgba(0, 0, 0, 0.2);
+ color: white;
+ cursor: pointer;
+ background: transparent;
+}
\ No newline at end of file
From 0516be3ef4cb60823937575344e1adcee112616b Mon Sep 17 00:00:00 2001
From: Abhinav Mishra <149368945+CoderUzumaki@users.noreply.github.com>
Date: Fri, 24 May 2024 14:38:25 +0530
Subject: [PATCH 3/7] Update README.md
---
Calculators/3D-Distance-Calculator/README.md | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/Calculators/3D-Distance-Calculator/README.md b/Calculators/3D-Distance-Calculator/README.md
index 8b1378917..d2125885d 100644
--- a/Calculators/3D-Distance-Calculator/README.md
+++ b/Calculators/3D-Distance-Calculator/README.md
@@ -1 +1,21 @@
+# 3D Distance Calculator
+
+## Description :-
+
+It calculates the distance between 2 points (upto 3 decimal places) in a 3-Dimensional Space. User can input the x, y and z co-ordinates of the two points and after hitting the "Get Distance" button, the calculated distance appears.
+
+## Tech Stacks :-
+
+- HTML
+- CSS
+- JavaScript
+
+## Screenshots :-
+
+![Screenshot 2024-05-24 143608](https://github.com/CoderUzumaki/CalcDiverse/assets/149368945/eb4f8300-d60f-47a2-9608-58fa5a5210c0)
+![Screenshot 2024-05-24 143639](https://github.com/CoderUzumaki/CalcDiverse/assets/149368945/c7e1178e-d246-40b6-af54-7e894a5f760f)
+
+
+
+
From 792031c78cc34d0492e0a9068a0f08f2654a3e3f Mon Sep 17 00:00:00 2001
From: Abhinav Mishra <149368945+CoderUzumaki@users.noreply.github.com>
Date: Fri, 24 May 2024 14:41:40 +0530
Subject: [PATCH 4/7] Update index.html
---
index.html | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/index.html b/index.html
index aab0626e6..c41add049 100644
--- a/index.html
+++ b/index.html
@@ -1951,7 +1951,21 @@ Calculates the linear density of the yarn from unit system to another.
-
+
+
+
+
#D Distance Calculator
+ Calculates the distance between 2 points in a 3D space.
+
+
+
@@ -1993,4 +2007,4 @@ Calculates the linear density of the yarn from unit system to another.