Question

For θ = 0°, 30°, 90°, 135°, 270°, and 321° show that sin-θ =-sin θ and tan (π-8) =-tan θ Print the results of θ, the left-hand side, and the right-hand side of each expression for each value of θ. For example, if θ = 73°, the output line might look like 311: for the ta 73.0000000 TAN: for theta3.0000000 right ght ide ide --。.95630 4789 = -3.270 e s 3 2 e left 蠫de --3·270e52 33

need help writing the Fortran code

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the FORTRAN code

program trig
REAL x1,x2,x3,x4,x5,x6
REAL y1,y2,y3,y4,y5,y6
y1=0
y2=30
y3=90
y4=135
y5=270
y6=321
z1=180-0
z2=180-30
z3=180-90
z4=180-135
z5=180-275
z6=180-321
  
x1=(0*3.1415927) /180
x2=(30*3.1415927) /180
x3=(90*3.1415927) /180
x4=(135*3.1415927) /180
x5=(270*3.1415927) /180
x6=(321*3.1415927) /180
  
z1=(z1*3.1415927) /180
z2=(z2*3.1415927) /180
z3=(z3*3.1415927) /180
z4=(z4*3.1415927) /180
z5=(z5*3.1415927) /180
z6=(z6*3.1415927) /180
  
PRINT *, "SIN for theta=",y1," left side=", SIN(-x1)," right side=",-SIN(x1)
PRINT *, "TAN for theta=",y1," left side=", TAN(z1)," right side=",-TAN(x1)
  
PRINT *, "SIN for theta=",y2," left side=", SIN(-x2)," right side=",-SIN(x2)
PRINT *, "TAN for theta=",y2," left side=", TAN(z2)," right side=",-TAN(x2)
  
PRINT *, "SIN for theta=",y3," left side=", SIN(-x3)," right side=",-SIN(x3)
PRINT *, "TAN for theta=",y3," left side=", TAN(z3)," right side=",-TAN(x3)
  
PRINT *, "SIN for theta=",y4," left side=", SIN(-x4)," right side=",-SIN(x4)
PRINT *, "TAN for theta=",y4," left side=", TAN(z4)," right side=",-TAN(x4)
  
PRINT *, "SIN for theta=",y5," left side=", SIN(-x5)," right side=",-SIN(x5)
PRINT *, "TAN for theta=",y5," left side=", TAN(z5)," right side=",-TAN(x5)
  
PRINT *, "SIN for theta=",y6," left side=", SIN(-x6)," right side=",-SIN(x6)
PRINT *, "TAN for theta=",y6," left side=", TAN(z6)," right side=",-TAN(x6)
end program trig

As we are dealing with trignomettric funtions there will be slight errors in value but it is very negligible as the left side and right side values will be too close

Add a comment
Know the answer?
Add Answer to:
need help writing the Fortran code For theta = 0 degree, 30 degree, 90 degree, 135...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Help with writing morse code

    Screen Shot 2021-03-17 at 9.57.42 AM.pngScreen Shot 2021-03-17 at 9.57.49 AM.png3 Decoding a Morse Code messageIn this exercise you will decipher a Morse code message sent to Agent 008 by Agent \(007 .\) The last words of Agent 007 were "The future of technology lies in \(\ldots\) " at which point she produced a memory stick containing a MATLAB file ctftmod.mat. The file ctftmod \(.\) mat contains the following:af, bf the denominator and numerator coefficients of a lowpass filter, whose...

  • My p1i = 6408.41640768       p2i = 4439.33266 Here is your task. Make a ...

    my p1i = 6408.41640768       p2i = 4439.33266 Here is your task. Make a diagram of the initial momentum vectors adding to the total momentum vector, �" = �W," + �:,". (This will look like the right side of your Vector Plotting diagram you did in lab.) Use the Law of Sines and the Law of Cosines to add them to find the magnitude and angle of �". Do this without switching to Cartesian vectors or making any right triangles. (You...

  • Description Write C++ code that correctly input and output information. (Moving data to and from the...

    Description Write C++ code that correctly input and output information. (Moving data to and from the screen and to and from text files. Also inputting predefined functions, etc., from included libraries.) Problem Description Consider a data file that has geometrical angle values in degrees. Angle values may be on one line, several lines, or any other white space separated format. Fig. 1 below shows one possible format, but other formats are possible. 12.9 100.8 270.5 300.6 120.8 There are no...

  • Can someone help me in java Net Beans IDE witht the code andjava comments. Thanks...

    Can someone help me in java Net Beans IDE witht the code and java comments. ThanksMany of these classes will just need to be copied from previous assignments. When you implement the Tree interface you may import the java.util.Iterator class. When you implement the AbstractBinaryTree class you may import the java.util.ArrayList class and the java.util.List class.In this project you will be doing the following:Create a NetBeans project named lab07 and ensure it is imported into your SVN.In this lab assignment...

  • I NEED SAMPLE PRINT OUT AS WELL AS CODE PLEASE!!!! Objectives: To gain experience with stacks....

    I NEED SAMPLE PRINT OUT AS WELL AS CODE PLEASE!!!! Objectives: To gain experience with stacks. Documentation: Explain the purpose of the program as detail as possible - 8%. Develop a solution for the problem and mention algorithms to be used -12% List data structures to be used in solution. - 5%. Give a description of how to use the program and expected input/output - 5% Explain the purpose of each class you develop in the program. - 5%. Programming:...

  • Hello I need help fixing some things so that the C++ code follows all the requirements...

    Hello I need help fixing some things so that the C++ code follows all the requirements listed below. Thanks, This needed to fix: Rule 3 (Not Satisfied): In rule 3 it is asked to use conditional statements only for the base-case and for all other conditional expressions you must use ternary operators. You have used "if", "else" statements multiple times so this rule was not satisfied. Rule 6 (Not Satisfied): As per this rule you are permitted to use upto...

  • Experiment: Equilibrium and LeChatelier's principle 1. Read and familiarize yourself with the lab. Writing a "recipe"...

    Experiment: Equilibrium and LeChatelier's principle 1. Read and familiarize yourself with the lab. Writing a "recipe" to follow might be a good way to do this. You'll finish lab faster as well. Do not go overboard with this recipe business, it is just a way to remember what you read and digest it better than usual. 2. Read and familiarize yourself with the equilibrium Chapter of your textbook. For prelab, hand in this sheet with the answer to what's below:...

  • QUESTION 1 Which statement results in the value false? The value of count is 0; limit...

    QUESTION 1 Which statement results in the value false? The value of count is 0; limit is 10. (count != 0)&&(limit < 20) (count == 0)&&(limit < 20) (count != 0)||(limit < 20) (count == 0)&&(limit < 20) 10 points    QUESTION 2 If this code fragment were executed in an otherwise correct and complete program, what would the output be? int a = 3, b = 2, c = 5 if (a > b) a = 4; if (...

  • Exercise #2: 10 M gals water per day 71-80 81-90 91-100 101-110 111-120 121-130 131-140 10...

    Exercise #2: 10 M gals water per day 71-80 81-90 91-100 101-110 111-120 121-130 131-140 10 M gals water per day 71-80 91-100 101-110 111-120 121-130 131-140 Create a data file named water.dat with the following data: 123 134 122 128 111 110 98 99 78 98 100 120 122 110 111 123 134 122 128 111 110 98 99 78 98 100 120 122 110 111. Each number represents the number of millions of gallons of water provided to...

  • I need help with this code, I'm stuck on it, please remember step 4, I'm very...

    I need help with this code, I'm stuck on it, please remember step 4, I'm very much stuck on that part. It says something about putting how many times it appears Assignment #1: Sorting with Binary Search Tree Through this programming assignment, the students will learn to do the following: Know how to process command line arguments. 1 Perform basic file I/O. 2. Use structs, pointers, and strings. Use dynamic memory. 3. 4. This assignment asks you to sort the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT