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
Notice that the iris.target array contains 3 different labels. Create a plot that you think is interesting using the data from t
Alexeev081 [22]

Answer:

from sklearn.datasets import load_iris

import seaborn as sns

import pandas as pd

data = load_iris()

final_data = data.data[:]

final_data = pd.DataFrame(final_data)

final_data.columns = ['SepalLengthCm', 'SepalWidthCm', 'PetalLengthCm', 'PetalWidthCm']

species = data.target[:]

final_data['Species'] = species

sns.pairplot(final_data, hue='Species')

Explanation:

8 0
3 years ago
What is the output of this line of code
LenKa [72]

Answer:

D - hellogoodbye

Explanation:

since your merging two string together you will simply just get one string in total

5 0
3 years ago
Read 2 more answers
Describe how to find out a file type by using your Computer.
user100 [1]

First you go to the 3 dots neer the x you pres it thin you go to downloads and it shod be ther i hop i help if so make me the branliy

8 0
3 years ago
Read 2 more answers
Which computer is the fastest to process complex data?
Andreas93 [3]

Answer:

D. 2.6 GHz processor, 8 GB RAM, 1 TB hard drive

Explanation:

In Computer science, the processor speed of a computer can be defined as the number of cycles per seconds that the central processing unit (CPU) of a computer operates. The processor speed typically determines the number of information that a computer is able to execute per seconds. Therefore, the higher or faster the processor speed the faster the computer in processing complex data.

Generally, the processor speed of a computer is measured in megahertz (MHz) or gigahertz (GHz).

Additionally, Radom Access Memory (RAM) can be defined as the main memory of a computer system which allow users to store commands and data temporarily. RAM is measured in megabytes (MB) or gigabytes (GB).

Generally, the Radom Access Memory (RAM) is a volatile memory and as such can only retain data temporarily.

All software applications temporarily stores and retrieves data from a Radom Access Memory (RAM) in computer, this is to ensure that informations are quickly accessible, therefore it supports read and write of files.

Hence, the computer which is the fastest to process complex data is the 2.6 GHz processor, 8 GB RAM, 1 TB hard drive because of the higher processor speed and RAM size.

7 0
3 years ago
Into which of these files would you paste copied information to create an integrated document? A. Mailing list B. Source C. Data
viva [34]

it would be b.mailing list


5 0
3 years ago
Read 2 more answers
Other questions:
  • Sarah has to pick images that display camera care. Which images would she pick to show camera care?
    11·1 answer
  • If there is more than one speaker, how should they be all noted?
    9·1 answer
  • A simple algorithm for handling requests works like this:________ a) all requests users make are stored. b) The elevator priorit
    15·2 answers
  • "The pkill command terminates _________."
    14·1 answer
  • One of the difficult decisions a systems analyst has to make when it comes to software is whether to recommend making, buying, o
    13·1 answer
  • Can a percent be used in a filename?
    13·1 answer
  • Su
    6·1 answer
  • A user is troubleshooting a mobile device app that is displaying errors and has contacted the app manufacturer’s technical suppo
    14·1 answer
  • A blog is Group of answer choices a character in Lineage,
    15·1 answer
  • A worksheet can have a maximum of number of rows​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!