-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e94359
commit 714100b
Showing
6 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Inductance Calculator | ||
|
||
## Description | ||
|
||
This project is a simple web-based **Inductance Calculator** that allows users to calculate the inductance of a coil based on parameters such as the number of turns, coil diameter, coil length, and core material. It is designed with a user-friendly interface, making it easy to input values and obtain the inductance result quickly. | ||
|
||
## Formula Used | ||
|
||
The inductance \( L \) of a solenoid is calculated using the following formula: | ||
|
||
| ||
${L}$ = μ$N^2$ ${A/l}$ | ||
|
||
|
||
Where: | ||
- L = Inductance (Henries) | ||
-N = Number of turns | ||
- A = Cross-sectional area of the coil | ||
- L = Length of the coil | ||
|
||
## Tech Stack | ||
|
||
- **HTML5**: For structuring the calculator interface. | ||
- **CSS3**: For styling the page and ensuring a responsive design. | ||
|
||
## Screenshot | ||
|
||
![alt text](image.png) | ||
![alt text](image-1.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Inductance Calculator</title> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
<div class="calculator-container"> | ||
<h1>Inductance Calculator</h1> | ||
<form id="inductanceForm"> | ||
<label for="turns">Number of Turns (N):</label> | ||
<input type="number" id="turns" required> | ||
|
||
<label for="area">Cross-sectional Area (A) in square meters:</label> | ||
<input type="number" id="area" step="0.0001" required> | ||
|
||
<label for="length">Length of Coil (l) in meters:</label> | ||
<input type="number" id="length" step="0.01" required> | ||
|
||
<button type="button" onclick="calculateInductance()">Calculate Inductance</button> | ||
</form> | ||
<div class="result" id="result"></div> | ||
</div> | ||
|
||
<script> | ||
function calculateInductance() { | ||
const turns = document.getElementById('turns').value; | ||
const area = document.getElementById('area').value; | ||
const length = document.getElementById('length').value; | ||
|
||
if (turns && area && length) { | ||
const inductance = (Math.pow(turns, 2) * area) / length; | ||
document.getElementById('result').innerText = `Inductance: ${inductance.toFixed(4)} H (Henries)`; | ||
} else { | ||
document.getElementById('result').innerText = 'Please fill out all fields.'; | ||
} | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
body { | ||
background-image: url("https://images.unsplash.com/photo-1526112562240-f3c31a27a110?q=80&w=1932&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"); | ||
font-family: Arial, sans-serif; | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
background-position: center; | ||
background-color: #f5f5f5; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
margin: 0; | ||
} | ||
|
||
.calculator-container { | ||
backdrop-filter: blur(50px); | ||
padding: 20px 30px; | ||
color: white; | ||
border-radius: 10px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
width: 300px; | ||
text-align: center; | ||
} | ||
|
||
h1 { | ||
margin-bottom: 20px; | ||
} | ||
|
||
form { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 10px; | ||
} | ||
|
||
label { | ||
text-align: left; | ||
} | ||
|
||
input { | ||
padding: 10px; | ||
border: 1px solid #ddd; | ||
border-radius: 5px; | ||
} | ||
|
||
button { | ||
padding: 10px; | ||
background-color: rgb(197, 62, 0); | ||
color: white; | ||
border: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
} | ||
|
||
button:hover { | ||
background-color: #0056b3; | ||
} | ||
|
||
.result { | ||
margin-top: 20px; | ||
font-size: 1.2em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters