Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

which is valid ?Math.cos(56)or .......  RSS feed

 
wei liu
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which is valid ?Math.cos(56)or Math.cos(Math.toRadians(56))orMath.cos(Math.toDegrees(56))
 
Junilu Lacar
Sheriff
Posts: 11127
160
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on what the units of 56 are. The API JavaDocs clearly state that the arguments for the trigonometric functions are angles in radians.
(Please bookmark the above link for your future reference -- you'll learn a lot more, a lot faster by trying to look things up yourself)
Junilu
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!