I developed this scientific calculator using HTML, CSS, and JavaScript. This calculator supports a wide range of mathematical functions, from basic arithmetic operations (addition, subtraction, multiplication, division) to advanced features such as trigonometry, logarithms, exponentiation, permutations, combinations, and more. It's not limited to solving basic expressions; it efficiently handles complex and nested expressions as I utilized the concept of regular expressions in JavaScript. Additionally, I incorporated features like calculation history and customizable default settings, etc., using the concept of local storage.
screenRecording.mp4
- HTML
- CSS
- JavaScript
In this project, I used HTML to structure the content, CSS to ensure styling and responsiveness, and JavaScript for dynamic interactions and to solve mathematical expressions. To achieve the mathematical computations, I used various built-in functions in JavaScript, such as eval() and the functions like Math.log(), Math.PI, Math.sin(), and others. Additionally, I implemented the concept of regular expressions in JavaScript to efficiently handle complex and nested expressions.
- Calculation History: Implemented using local storage to keep track of previous calculations.
- Settings Button: Added buttons to adjust default settings for enhanced user customization.
- Addition
- Subtraction
- Multiplication
- Division
- and more...
- Sine
- Cosine
- Tangent
- Arcsine
- Arccosine
- Arctangent
- Logarithm (with any base)
- Natural logarithm (base e)
- Exponential power
- e^x
- 10^x
- Square Root
- Permutation and Combination calculations
- Factorial computation and many more.
Although I have tried my best to replicate the features of the mobile inbuilt calculator, it cannot handle all complex expressions perfectly. However, these complex mathematical expressions can be easily handled using regular expressions in JavaScript, but due to limited time, I did not do so.
Follow the steps below to install and run the project on your local machine.
1. Clone this repository:
git clone https://github.com/Ankit-Matth/scientific-calculator.git
2. Access the project directory:
cd scientific-calculator
3. Open the index.html
file in your web browser and see the magic.