+ 5
Math.sqrt, Math.abs, math.sin, math.cos
Can anybody tell me what does these classes do?
4 odpowiedzi
+ 15
●Math.sqrt(a) returns square root of value a
●Math.abs(a) return absolute value(ie distance from origion , which will be always positive , it works like modulus function) of value a
●Math.sin(a) return sine of angle a
●Math.cos(a) returns cosine of angle a
//these are methods , class name generally starts with Capital letter[tip to identify class name]
+ 10
● Math.sqrt(4.0) //2.0
● Math.abs(-2.0) //2.0
● Math.sin(Math.toRadians(30)) //0.5
● Math.cos(0) //1.0
//as by default we give value of angle in radian in trigonometric ratios
+ 3
Thanks buddy👍
+ 2
Can you give me some example? Plz