Ticker

10/recent/ticker-posts

Header Ads Widget

SinX Calculator Source Code



SinX Calculator




Click Here to find SinX

SinX Calculator Source Code

In mathematics often we need to find the sine value of non-standard angles like 40, 50, 70, 79,  and many more angles. Without using the sine table we are now able to calculate the sine value of any angle from 0 degree to 90 degree with the help of this calculator. 

So use this calculator and give surprise to your class fellows.

To design a sinX calculator, we will use a Vedic mathematics formula. Here is the simplified source code for the calculation of sine value of any angle between 0 to 90 degree. Here we have used HTML , CSS and JavaScript to make the calculator fully functional.

<!DOCTYPE html>
<html>
<head>
    <title>SinX Calculator</title>
    <script>
        function calculateSinX() {
            var x = parseFloat(document.getElementById("xValue").value);
            var sinX = (4 * x * (180 - x)) / (40500 - x * (180 - x));
            document.getElementById("result").innerHTML = "SinX = " + sinX.toFixed(4);
        }
    </script>
    <style>
    #sinX-container{
        background:blue;
        color:white;
        padding:20px;
    }
    #sinx-calc{
        display:block;
        background:white;
        text-align:center;
        float:center;
        padding:15px;
        font-size:25px;
        border:1px solid blue;
        border-radius:8px;
        font-weight:800;
        margin:10px auto;
    }
    input[type=text]{
        display:block;
        margin:15px auto;
        height:30px;
        border-radius:12px;
        text-align:center;
        font-size:25px;
        padding:8px;
        font-weight:800;
    }
    #result{
        text-align:center;
        font-size:25px;
        font-weight:900;
        color:red;
    }
    label{
        text-align:center;
        font-size:25px;
        display:block;
        margin:5px auto;
        font-weight:900;
    }
    </style>
</head>
<body>
   <div id="sinX-container">
    <h1 style=" text-align:center; padding:20px;">SinX Calculator</h1>
    <label for="xValue">Enter the value of X<br> (in Degrees) from 0° to 180°:</label><br>
    <input type="text" id="xValue" placeholder="Value In Degree"><br><br>
    <button id="sinx-calc" onclick="calculateSinX()">Calculate</button>
    <p id="result"></p>
    <p style="color:white;text-align:center;font-size:20px;font-weight:900;"><a style="color:white;"href="#">Click Here to find SinX</a></p>
    </div>
</body>
</html>

Post a Comment

0 Comments