# Calculating temperature of objects after colliding

So, I'm making a physics engine, and I need to know what is the temperature object A has after colliding with object B.

Object A is 10 earths in diameter, and is 10 earths in mass. Object B is 5 earths in diameter, and 5 in mass.

Now, A is traveling at a constant speed of 200 m/s towards B, and B is traveling at 200 m/s towards A. What would be the final temperature of A after this perfectly unelastic collision?

I know the mass, surface, initial velocity, final velocity, initial temperature and quite basically every value of both.

EDIT: I also know the kinetic energy of both.

• What is the change in kinetic energy? – Chet Miller Nov 25 '18 at 21:42
• I said it is a physics engine, I am not trying to calculate this value in real life. I do not know the change in kinetic energy because of that. – VetraDebesis Nov 25 '18 at 21:50
• You said, "I also know the kinetic energy of both." Do you know how to calculate the final kinetic energy, and the change in kinetic energy? From the first law of thermodynamics, the increase in internal energy of the two masses is going to be equal to the decrease in kinetic energy from the initial state to the final state. – Chet Miller Nov 25 '18 at 21:54
• Oh, I don't know how to calculate the change. So, the change in temperature is the smae as the change in kinetic energy? – VetraDebesis Nov 25 '18 at 22:24
• Temperature is not a simple thing to calculate. It depends on energy input and heat capacity (which are pretty simple), but also on heat distribution, heat flow (including radiation losses) and initial temperature distribution. For planet sized masses, this is either very complex or completely unrealistic (such as by assuming no heat loss and uniform temperature distribution) – BowlOfRed Nov 25 '18 at 22:36