Explanation:
what "normal" trigonometric function did this remind us of ?
it starts at "high" for x = 0.
"high" signs mean "1" for the standard functions.
the trigonometric function that starts with 1 at x = 0 is cosine.
so, this is a cosine function that we need to scale properly.
original value : 1
graph : 15
original value : -1
graph : 12
original value : 0
graph : (15+12)/2 = 27/2 = 13.5
so, we need to add this to the cosine function result.
the distance from the 0 level (13.5) to high or low is 1.5 (instead of originally 1).
Du, we need to stretch the cosine function result to go from -1.5 to +1.5 (12 to 15).
and for the x-axis :
12 hours = 180° or pi (the interval for cosine to go from +1 to -1).
1 hour = 180/12 = 15° or pi/12.
so, for cosine to react to the hour value as for the curdling degrees we need to multiply x by 180/12 or by pi/12.
so, our temperature function temp(x) is then
temp(x) = 1.5×cos(x×180/12) + 13.5
or
temp(x) = 1.5×cos(x×pi/12) + 13.5