subject

In Java pls help ASAP In this program we are going to practice using the Math class by computing some important values on the unit circle. Using the angles 0, PI/2, and PI, print out the angle, the cosine of the angle, and the sine of the angle.

Your output should look like this:

Radians: (cos, sin)
0.0: 1.0, 0.0
1.5707963267948966: 0.0, 1.0
3.141592653589793: -1.0, 0.0
Hints:

You’ll need to use the Math. sin, Math. cos methods
and the Math. PI constant!
You can round a decimal to 2 decimal places by multiplying by 100, rounding to the nearest int using Math. round, and then dividing by 100. You will need to round the sine and cosine values. Here’s an example:
double angle = Math. PI/4;
double cosine = Math. cos(angle); // 0.707106781
cosine = cosine * 100; // 70.7106781
cosine = Math. round(cosine); // 71.0
cosine = cosine / 100.0; // 0.71

// Or put it all on one line:
cosine = Math. round(cosine * 100) / 100.0;

Some Math Background
The Java methods need the angles to be in radians, rather than degrees. PI/2 radians is equal to 90 degrees. PI radians is equal to 180 degrees.
That’s why we’re using multiples of PI in this exercise.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
In outlook how can cherie look at the details of an event that appears on the month view of her calendar? check all that apply. by switching to the detail view by switching to the week view by switching to the day view by right-clicking on the event by double-clicking on the event by highlighting the event
Answers: 2
question
Computers and Technology, 22.06.2019 21:30
Im doing this last minute and literally none of my neighbors or people that my dad works with use excel so if anyone could me make up an example
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
question
Computers and Technology, 23.06.2019 10:50
The volume v and paper surface area a of a conical paper cup are given by where r is the radius of the base of the cone and h is the height of the cone. a. by eliminating h, obtain the expression for a as a function of r and v. b. create a user-de ned function that accepts r as the only argument and computes a for a given value of v. declare v to be global within the function. c. for v ! 10 in.3 , use the function with the fminbnd function to compute the value of r that minimizes the area a. what is the corresponding value of the height h? investigate the sensitivity of the solution by plotting v versus r. how much can r vary about its optimal value before the area increases 10 percent above its minimum value?
Answers: 1
You know the right answer?
In Java pls help ASAP In this program we are going to practice using the Math class by computing so...
Questions
Questions on the website: 13722360