setInterval method, the syntax is as follows:
myVariable=setInterval(myfunction, time interval)
The setInterval method runs a function created by you at a certain time interval in milliseconds. For example, a time interval of 1000 equals to 1 second.
Here are some examples of animations created by us:
To draw a quadratic curve, we use the quadraticCurve() method. However, we need to combine the quadraticCurve() method with the beginPath() and moveTo() methods in order to draw a quadratic curve. The beginPath() and moveTo() methods define the starting point of the quadratic curve. The quadraticCurve() method is to define the lowest point to the end point of the quadratic curve. The syntax of the quadraticCurve() method is
Please follow the following link to learn more.
Drawing a Quadratic Curve
Pythagoras Theorem is used to solve problems related to the length of the sides of a triangle.
The formula to is
AB is the opposite side, AC is the adjacent and BC is the hypotenuse of a triangle ABC.
Read more here
where weight is in kg and height in cm.
In the html page, you can create three text box using the <input> tag to accept the user inputs for name, height and weight.
- toFixed method is to round the output to 2 decimal ppalces
The html document is
<h1>Student Name=<input type=”text” style=”font-size:25px; font-weight: bold;” id=”studentname”></h1>
<h2>Height=<input type=”text” style=”font-size:20px; font-weight: bold;” id=”hgt”></h2>
<h2>Weight=<input type=”text” style=”font-size:20px; font-weight: bold;” id=”wgt”></h2>
<input type=”button” value=”Calculate” onclick=”bmi()”>
Click here to launch the BMI calculator