This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes which is valid ?Math.cos(56)or ....... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "which is valid ?Math.cos(56)or ......." Watch "which is valid ?Math.cos(56)or ......." New topic
Author

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

wei liu
Ranch Hand

Joined: Dec 06, 2001
Posts: 56
which is valid ?Math.cos(56)or Math.cos(Math.toRadians(56))orMath.cos(Math.toDegrees(56))
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 5516
    
  14

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

Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://kickstarter.com/rocket-mass-heater
 
subject: which is valid ?Math.cos(56)or .......