1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MaRussiya [10]
3 years ago
5

In this program we are going to practice using the Math class by computing some important values on the unit circle. Using the a

ngles 0, PI/2, and PI, print out the angle, the cosine of the angle, and the sine of the angle.
Computers and Technology
1 answer:
san4es73 [151]3 years ago
5 0

Answer:

The program in Java is as follows:

import java.lang.Math;

public class Trig{

public static void main(String args[]){

for(double angle = 0; angle <= Math.PI; angle += Math.PI / 2){

double cosX = Math.round(Math.cos(angle)*100.0)/100.0;

double sinX = Math.round(Math.sin(angle)*100.0)/100.0;

System.out.println((Math.round(angle*100)/100.0)+" --> "+cosX +" --> "+ sinX);

}}}

Explanation:

This line imports the math library into the program

import java.lang.Math;

This line defines a class

public class Trig{

This line defines the main method

public static void main(String args[]){

This line is an iteration that iterates from 0, through Math.PI using Math.PI/2 as an interval

for(double angle = 0; angle <= Math.PI; angle += Math.PI / 2){

This calculates the cosine of the angle (in radians)

double cosX = Math.round(Math.cos(angle)*100.0)/100.0;

This calculates the sine of the angle (in radians)

double sinX = Math.round(Math.sin(angle)*100.0)/100.0;

This prints the angle in radians, the cosine and the sine of the angle

System.out.println((Math.round(angle*100)/100.0)+" --> "+cosX +" --> "+ sinX);

}}}

You might be interested in
In a well-developed paragraph - using domain-specific vocabulary and academic writing - address the following writing prompt:
egoroff_w [7]

Answer:

GIGO is a computer science acronym that implies bad input will result in bad output. Good programming practice dictates that functions should check for valid input before processing it. ... A well-written program will avoid producing garbage by not accepting it in the first place.

Explanation:

4 0
2 years ago
True or False
steposvetlana [31]

Answer:

1. False

2. False

3. True

4. False

Explanation:

1. Folders are the containers to store files

2. The delete option deletes the file

3. Files are moved to recycle bin after being deleted, and can be permanently deleted from recycle bin

4. "MS-DOS was the main operating system for IBM PC compatible personal computers during the 1980s, from which point it was gradually superseded by operating systems offering a graphical user interface (GUI), in various generations of the graphical Microsoft Windows operating system."

<em>source for #4: Wikipedia</em>

3 0
2 years ago
Consider two vectors that are NOT sorted, each containing n comparable items. How long would it take to display all items (in an
Darina [25.2K]

Answer:

The correct answer to the following question will be "Θ(​n​2​)

". The further explanation is given below.

Explanation:

If we're to show all the objects that exist from either the first as well as the second vector, though not all of them, so we'll have to cycle around the first vector, so we'll have to match all the objects with the second one.

So,

This one takes:

= O(n^2)

And then the same manner compared again first with the second one, this takes.

= O(n^2)

Therefore the total complexity,

= Θ(​n​2​)

7 0
3 years ago
What is a focus of Accenture's point of view on blockchain in the marketplace?
Ipatiy [6.2K]

Answer:

enabling clients to store all their data, documents, and employee information on blockchain. accumulating the most data from wherever possible and building a comprehensive data lake.

Explanation:

4 0
2 years ago
What makes manually cleaning data challenging?
Alexxandr [17]

Manually cleaning data is done manually which makes it challenging. This make it prone to mistakes.

6 0
3 years ago
Other questions:
  • A matrix representation stores matrices such that the offset address of the element in row i and column j can be calculated by c
    12·1 answer
  • Although the Earth's crust formed relatively early in the Earth's history, it was not present when the Earth first began to form
    12·2 answers
  • Sorting table rows is based on the data in the selected        A. cell range.   B. cell.   C. column.   D. row.
    12·2 answers
  • Help me out with this .....
    10·1 answer
  • True or false: when an ospf route sends its link state information, it is sent only to those nodes directly attached neighbors.
    14·1 answer
  • The _device provides a means of communication between a computer and outer world.​
    14·1 answer
  • describe a situation in which peer pressure could cause a serious problem for safe driving, and how you could resist the peer pr
    8·2 answers
  • What resources can be shared over a computer network?
    12·2 answers
  • A well-known production is making a documentary film titled “The Dwindling Population of Grizzly Bears in the United States.” Wh
    5·1 answer
  • True or false: Concurrent validation is more time consuming to measure than predictive validation because it involves a wait per
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!