Question

1. Using Python to Calculate the value of sin4, assuming 4 is in radians and that...

1. Using Python to Calculate the value of sin4, assuming 4 is in radians and that the sin function available in Python accepts radians. Store the result in a variable sin4.

2.Using Python to Calculate the value of sin4∘in degrees. Since the sin function available in Python accepts radians, you will need to convert degrees to radians. math.radians is a function which accepts degrees and returns the radians equivalent. Store the result in a variable sin4d.

Homework Answers

Answer #1

import math

# Using Python to Calculate the value of sin4, assuming 4 is in radians and that the sin function available in Python accepts radians. Store the result in a variable sin4.
sin4 = math.sin(4)

# Using Python to Calculate the value of sin4∘in degrees. Since the sin function available in Python accepts radians, you will need to convert degrees to radians. math.radians is a function which accepts degrees and returns the radians equivalent. Store the result in a variable sin4d.
sin4d = math.sin(4*(math.pi/180))
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Using Python: Create a code to generate 1001 values between 0 and 10 (essentially, start from...
Using Python: Create a code to generate 1001 values between 0 and 10 (essentially, start from 0 and use increment 0.01) and for each value ? ∈ [0,10] calculate sin(?) and the derivative of ?(x) = sin(?) using the central difference method: ????(?)/?? = ?(?+0.01)−?(?−0.01) 2∙0.01 . Output the result in a file using the print command: print (?, ???(?) , ????(?), ??? =′ ′, ??? =′\ ? ′ , ???? = ??) Recall that the output file must be...
In python, write a function that converts an input latitude or longitude value in degrees, minutes,...
In python, write a function that converts an input latitude or longitude value in degrees, minutes, and seconds (DMS; no decimals) into decimal degrees (DD). Directions: The function should take a tuple containing three numbers representing degrees, minutes and seconds and returns the corresponding decimal degree equivalent. You can assume if the degree value is negative all 3 fields are negative. Thus “-30 30 00” is -30.5 degrees, not -29.5 degrees. Test your function with some known values before you...
Wtite a Python script to print a range of alphabetic characters ‘a’ to ‘z’ using the...
Wtite a Python script to print a range of alphabetic characters ‘a’ to ‘z’ using the custom range() function. You will need to use the ASCII character value and then convert the ASCII value to a alphabetic letter using a chr() function. Expected Output (submit code and output): Generate the characters from a to z, inclusive.
Module 4 Assignment 1: Pseudocode & Python with Variable Scope Overview Module 4 Assignment 1 features...
Module 4 Assignment 1: Pseudocode & Python with Variable Scope Overview Module 4 Assignment 1 features the design of a calculator program using pseudocode and a Python program that uses a list and functions with variable scope to add, subtract, multiply, and divide. Open the M4Lab1ii.py program in IDLE and save it as M4Lab1ii.py with your initials instead of ii. Each lab asks you to write pseudocode that plans the program’s logic before you write the program in Python and...
2 = ABC , 3 = DEF , 4 = GHI , 5= JKL = 6...
2 = ABC , 3 = DEF , 4 = GHI , 5= JKL = 6 =MNO , 7= PQRS, 8= TUV , 9 = WXYZ ( 1 has no letters with it). Write a function named converted_number which accepts a phone number in the form (900)HEY-MATE and returns the formatted phone number equivalent (900)439-6283. In python! Please and thanks!
Printing the value in the function, modify your function so that it returns a value of...
Printing the value in the function, modify your function so that it returns a value of true or false. Do not print anything from inside function itself. Call your function and have the return result of the function (Boolean True or False). Do not create a string called "True" or "False". Do not create a string called "Equal" or "Not Equal" here. Actually return a boolean. Create a variable in your main code outside of the is_equal function store the...
Create a Python main program which calls two functions enterNum and calcResult and accomplishes the following:...
Create a Python main program which calls two functions enterNum and calcResult and accomplishes the following: 1. The main program calls the function enterNum 3 times. The first time enterNum is called, the main program stores the returned output in the variable xx. The second time, the returned output is stored in the variable yy and the third time in zz. 2. enterNum asks the user to enter a floating point number. This function has no input arguments and returns...
Create a program that the simulates a thermometer and displays its temperature using different units. 1-...
Create a program that the simulates a thermometer and displays its temperature using different units. 1- Temperature Interface (Temperature.java) This interface should declare the following two abstract methods: • getTemperature      o Returns a String o Accepts no arguments • setTemperature      o Returns void o Accepts one double argument 2- Abstract Thermometer Class (Thermometer.java) This abstract class must implement the Temperature interface and contain: • One private field (a double) named degrees • One constructor that accepts a double...
PYTHON: Using the function random.random_sample from numpy package write two functions: * poissonRV(seed, mean,n) that returns...
PYTHON: Using the function random.random_sample from numpy package write two functions: * poissonRV(seed, mean,n) that returns for given seed a bunch of n Poisson distributed random numbers with the provided mean. You have to numerically calculate the inverse distribution function. funnyDiceRV(seed,n) that returns for given seed a bunch of n random number which describe a biased die with distribution ℙ({1})=ℙ({2})=ℙ({3})=ℙ({4})=ℙ({5})=1/10P({1})=P({2})=P({3})=P({4})=P({5})=1/10 and ℙ({6})=1/2P({6})=1/2.
Function which takes a string and uses a stack to calculate the value of theequation passed...
Function which takes a string and uses a stack to calculate the value of theequation passed in. This equation is assumed to be in postfix/reverse Polishnotation. RETURNS: The value that the equation evaluates to using postfix notation python please :)
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT