Creating a dynamic gradient for a temperature Map

46 Views Asked by At

Introduction

I am currently working on a simulation project. I want to simulate temperature variations like on earth's equator.

Problem

I am doing everything in C# and Unity but my question is more mathematical than actual coding.

In order to create a gradient (for the temperature variation), i though to divide the height of the 2D map into "Temperature Areas" but i would like something more dynamic and that is the reason why i am asking.

I though to create a mathematical function to create that gradient and make it dynamic.

Something like in this image

where the factors at the y-axis (vertical) says if that region is hot, cold, warm, etc. via some conditions (if, if else... then add colour)

The final result is to simulate the earth's equator as seen here but in 2D:

enter image description here

My attempt:

enter image description here

But that is not giving me what I expected.

Question:

How I could make a mathematical function which has a peak (i.e x = 50) and from there it goes down to 0 or less?

Thanks for the time and interest in this question.