Quadratic

Size
2,234 Kb
Views
6,072

How do I make an quadratic?

What is a quadratic? How do you make a quadratic? This script and codes were developed by Anthony Keithley on 24 December 2022, Saturday.

Quadratic Previews

Quadratic - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Quadratic</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="container">
<h1>Quadratic Root Finder</h1>
<h2>Given a quadratic function in the form of y = ax<sup>2</sup>+bx+c, enter the values for a, b, and c below to find the real roots of the function.</h2> <div id="inputs">
<h3>y = <input type="number" id="a" value="1"> x<sup>2</sup> + <input type="number" id="b" value="3"> x +
<input type="number" id="c" value="2"> </h3> <br>
<br>
<button onclick="findRoots()">Find roots</button>
<p>Roots: <span id="roots"></span></p> </div> <div id="calculator" style="width: 600px; height: 400px;"></div> </div>
<script src="https://www.desmos.com/api/v0.8/calculator.js?apiKey=dcb31709b452b1cf9dc26972add0fda6"></script> <script src="js/index.js"></script>
</body>
</html>

Quadratic - Script Codes CSS Codes

#container { width: 600px; margin: 0px auto; text-align: center;
}
h1, h2 { text-align: center;
}
input { width: 30px;
}
body { color: white; background: darkslategray;
}

Quadratic - Script Codes JS Codes

var elt = document.getElementById('calculator');
var calculator = Desmos.GraphingCalculator(elt);
function findRoots(){ var a = document.getElementById("a").value; var b = document.getElementById("b").value; var c = document.getElementById("c").value; var roots, x1, x2; var disc = b*b - 4*a*c; x1 = ((-b) + Math.sqrt(disc))/ (2 * a); x2 = ((-b) - Math.sqrt(disc))/ (2 * a); if(disc < 0){ roots = "No solution"; } else if(x1 == x2){ roots = "(" + x1 + ", 0)"; } else { roots = "(" + x1 + ", 0)" + " and " + "(" + x2 + ", 0)"; } document.getElementById("roots").innerHTML = roots; calculator.setExpression({id:'graph1', latex:'y=' + a + 'x^2+' + b + 'x+' + c});
}
Quadratic - Script Codes
Quadratic - Script Codes
Home Page Home
Developer Anthony Keithley
Username KeithleySLHS
Uploaded December 24, 2022
Rating 3
Size 2,234 Kb
Views 6,072
Do you need developer help for Quadratic?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Anthony Keithley (KeithleySLHS) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!