Are you saying that your input is a number between 0 and 60 degrees, and you need an output that is -18 to +48? If so, just subtract 18, and you’ll have your desired range. Because the size of the two ranges are equal, you only have to shift the input through addition/subtraction to transform it into the output range.

I am making the temperature in the game go from -18 degrees Celsius to +48 degrees Celsius.

-18 is the temperature in the night time and +48 is the daytime temperature. -18 and +48 is not set in stone and can be changed to whatever I would like.

So, when the sun is at 0 degrees of 360 degrees, it is in top center of sky shining down.
When sun is at 90 degrees, nighttime starts.
When sun is at 270 degrees, daytime is starts.
I want the temperature to start go up when the sun get to 270 degrees.
The temperature will go from -18 degrees Celsius “or whatever I choose” to +48 degrees Celsius “or whatever I choose” .
The span of wich the temperature will change is 60 degrees “from 270 degrees to 330 degrees”.

I see now. The first thing you’ll need to do then is adjust your sun angle to a range from 0 to 1. 0 means minimum temperature, 1 means maximum temperature. You do this by subtracting the minimum angle (270), then dividing by the range between minimum angle and maximum angle (60). Once you have a value t between 0 and 1, you can use Mathf.Lerp(minTemperature, maxTemperature, t).

You can do a similar thing for the 90 to 150 degree range, for nightfall. And since Mathf.Lerp() automatically clamps the lerp parameter to between 0 and 1, you can simplify things a bit and still not worry about temperatures getting outside your desired range.

It’s easy, and common, to get all confused about syntax and lerps and quaternion.euler. This is an 8th grade algebra problem. A trick to writing programs is to break it down into simple parts.

If you know anyone maybe 14-16 years old ask them how to solve an equation for the line through x=0,y=-18 and x=1,y=48. It sounds silly, but seeing a kid solve it helps you remember that you really did learn that stuff, and just forgot it. It makes it easier to pick out solvable math later on.