In this part of the lab, you must write a program in C that prints the temperature at equally spaced points on a triangular plate.
We assume that the triangular plate that is enclosed by the lines x = 0 and y = 0 and x + y =100. Start by sketching this region on a piece of paper. The temperature at a point (x,y) on this plate is given by:
T(x,y) = sin( x + y ) e -(x+y)/100
Your program must:
print the temperature at points spaced 20 units apart in the x-direction (starting at x = 0 ) and 10 units apart in the y-direction (starting at y = 0)
print the temperature to 5 decimal places in a field of width 9
Here is the expected output given the specification provided above:
-0.16728 -0.44658 -0.18628
-0.15914 0.38430 0.36347
0.49946 -0.16728 -0.44658 -0.18628
-0.73195 -0.15914 0.38430 0.36347
0.74746 0.49946 -0.16728 -0.44658 -0.18628
-0.49225 -0.73195 -0.15914 0.38430 0.36347
0.00000 0.74746 0.49946 -0.16728 -0.44658 -0.18628
Note that the first line of output above corresponds to the row y = 100 while the last line corresponds to y = 0.
Write your program in such a way that the separation between points can be changed easily.
You will find the following functions in the library math.h useful:
double sin( double angle ); /* returns the sine of angle */
double exp( double num ); /* returns e^num */
Having some trouble with this problem..anyone have some ideas for a solution?