Found 10877 Articles for Web Development

How to get the cosine of a number in JavaScript?

Shubham Vora
Updated on 06-Sep-2022 14:17:27

430 Views

In this tutorial, we will learn how to get the cosine of a number in JavaScript. The cosine cos (x) function is a fundamental function used in trigonometry (the others being the cosecant, cotangent, secant, sine, and tangent). The cosine of an angle is commonly defined as the ratio between the lengths of the side of the triangle adjacent to the angle and the hypotenuse, i.e., cos x = (adjacent/hypotenuse). Let theta be a counter-clockwise angle measured from the x-axis along the arc of the unit circle then the arc termination’s horizontal location called cos (theta). Following are the methods ... Read More

How to get the smallest integer greater than or equal to a number in JavaScript?

Shubham Vora
Updated on 15-Sep-2022 12:24:52

2K+ Views

In this tutorial, we will learn how to get the smallest integer greater than or equal to a number in JavaScript. To get the smallest integer greater than or equal to a number, use the JavaScript Math.ceil() method. This method returns the smallest integer greater than or equal to a given number. In other words, the Math.ceil() method rounds a number and returns an integer result. Because the ceil() method is a static function of the Math object, it must be invoked via the Math placeholder object. The ceil() method produces the lowest integer value that is bigger than or ... Read More

How to get the arctangent of the quotient of its arguments in JavaScript?

Shubham Vora
Updated on 06-Sep-2022 14:08:52

131 Views

In this tutorial, we will learn how to get the arctangent of the quotient of its arguments in JavaScript. The JavaScript math object has several constants and methods for performing mathematical operations. It does not have constructors, unlike the date object. JavaScript Math is one of the built-in objects that contains attributes and methods for mathematical constants and functions, as well as methods for executing mathematical operations. It is neither a function nor a function object. Because Math's properties and methods are static, you can refer to it as an object without constructing it. Following are the ways to find ... Read More

How to get the arctangent (in radians) of a number in JavaScript?

Giri Raju
Updated on 06-Sep-2022 14:02:01

138 Views

In this tutorial, we will learn how to get the arctangent (in radians) of a number in JavaScript. We can use the JavaScript Math object to perform mathematical operations on integers. Math is a pre-defined object with attributes and methods to perform different mathematical functions and constants. This isn't a function object. Math functions work with the Number data type, and it is incompatible with BigInt. Math, unlike many other global objects, does not have a function Object(). Math's methods and properties are all fixed. The Math.PI represents the constant pi, while the sine function is also referred to as ... Read More

How to get the arcsine (in radians) of a number in JavaScript?

Shubham Vora
Updated on 31-Oct-2022 08:32:50

172 Views

This tutorial will help you to find the arcsine in radians of a number in JavaScript. Sine is the ratio of the opposite side and hypotenuse of the right triangle they define. To get the sine of a number, the Math.sin() function is used in JavaScript. It returns a value between 1 and -1. This represents the sine of an angle. This will be in radians. The inverse of sine is called Arc sine. An angle's trigonometric Arc sine value can be calculated using asin() method. This returns a value between -π/2 and π/2. The input to asin() method is ... Read More

How to get the arccosine (in radians) of a number in JavaScript?

Shubham Vora
Updated on 31-Oct-2022 08:13:28

150 Views

This tutorial will help you to find the arccosine in radians of a number in JavaScript. Cosine is the ratio of the adjacent side and the hypotenuse of the right-angled triangle which is defined by them. To get the cosine of a number, the Math.cos() function is used in JavaScript. The value returned will be between -1 and 1. This denotes the cosine of an angle. This will be in radians. The inverse of cosine is called Arc cosine. An angle's trigonometric Arc cosine value can be calculated using acos() method. This returns a value between 0.0 and pi. The ... Read More

How to get the square root of 2 in JavaScript?

Shubham Vora
Updated on 26-Aug-2022 13:20:46

789 Views

In this tutorial, we shall learn to get the square root of 2 in JavaScript. The square root of 2 is an irrational number, and it is called Pythagoras's constant. We can’t denote it in fractions, and it has an infinite number of decimals; hence, we can’t find its exact value. The √2 value is 1.414. HTML encoding of the square root symbol in JavaScript is √. Next, we will discuss the available method to find the square root of 2. Using Math object's SQRT2 property In this part, we will see how the SQRT2 property of the Math object ... Read More

How to get the value of PI in JavaScript?

Shubham Vora
Updated on 14-Sep-2022 09:02:50

2K+ Views

In this tutorial, we will learn how to get the value of PI in JavaScript. The PI is a mathematical constant that is widely used in different sections of mathematics. It is defined by the ratio of the circumference of a circle to its diameter, which is approximately 3.14159. It is represented by the symbol ‘𝜋’, which is a Greek letter. The value of PI is an Irrational number, which means the value of the PI can’t be expressed as a fraction, and the digits that came after the decimal is non−terminating and non−repeating. The value of PI in JavaScript ... Read More

How to get base 10 logarithms of E in JavaScript?

Ramu Prasad
Updated on 19-Jun-2020 07:22:18

72 Views

To get base 10 logarithms of E, use the Math LOG10E property. It returns base 10 logarithm of E which is approximately 0.434.ExampleYou can try to run the following code to get base 10 logarithms of E in JavaScript −           JavaScript Math LOG10E Property                        var property_value = Math.LOG10E          document.write("Property Value: " + property_value);          

How to get base 2 logarithm of E in JavaScript?

Sravani S
Updated on 16-Jan-2020 07:29:51

198 Views

To get base 2 logarithms of E, use the Math LOG2E property. It returns base 2 logarithm of E which is approximately 1.442.ExampleYou can try to run the following code to get base 2 logarithms of E in JavaScript:           JavaScript Math LOG2E Property                        var property_value = Math.LOG2E          document.write("Property Value is : " + property_value);          

Advertisements