The difference in cents between musical notes is determined by the equal-tempered scale, which is the most common tuning system in Western music. In this system, the octave is divided into 12 equal parts, with each part being a semitone or half step. This means that each semitone is approximately 100 cents apart.
For example, if you take the note C and move up to C# (the note a half step above), there is a difference of 100 cents. If you move from C to D, which is two whole steps up, there will be a difference of 200 cents. Continuing this pattern, the relationship between any two notes can be calculated based on how many semitones are between them, with each semitone representing 100 cents.
To summarize, the distance in cents between notes is calculated as the number of semitones multiplied by 100, which provides a precise way to measure the intervals in Western music.