First, let's assume you are in orbit around the Earth's atmosphere, and you threw the cookie sunward at 25 mph (40km/h). The most delicious of speeds.

We can approach this problem by first asking a more general question: What is the temperature vs. time for a lump of cookie dough in orbit around the sun? Then we can take a look at different orbits and see if we can achieve the necessary conditions for baking a cookie. Let's assume we're far enough from the earth that we can neglect the atmosphere. Say, on the moon.

To jump to the conclusion, the general problem is that, to bake a cookie, you want to put it in a fairly narrow temperature window for a short time. As far as I know, it's not ideal to "slow-cook" a cookie. Typical orbits around the sun that start from the earth, unsurprisingly, take on the order of one year. So even if you design a trajectory that heats the cookie up to just the right temperature, it is going to spend many a day at temperatures just *slightly* lower than ideal. That would probably not produce a tasty cookie.

The best way to make it work is to shoot the cookie at speeds that are a *significant* fraction of the speed of light. Of course, this isn't really possible with current technology. And it raises the problem of retrieving the cookie after it's baked, as it will pretty quickly leave the solar system and never return. But that's another problem for another day.

First, let's calculate the distance r(t) from the cookie dough to the sun as a function of time. This can be found by numerically solving the coupled differential equations that we get from Newton's law F=ma in polar coordinates (r, theta), where the force is the gravitational force from the sun:

And:

Where M is the mass of the sun and G is the gravitational constant.

I did this using Mathematica, with the initial distance r(0) the radius of the earth's orbit, and and initial speed v0, oriented at angle phi0 measured with respect to the line connecting the earth and sun.

Second, we must calculate the temperature of the dough as a function of time as it travels on the trajectory calculated above. Transfer of heat into the dough will occur via absorption of light from the sun, resulting in power absorbed by the cookie (energy per time):

Where Ps is the total output power of the sun and A1 is the cross-sectional area of the cookie facing the sun.

Transfer of heat out of the dough will occur via blackbody radiation:

Where A2 is the total surface area of the cookie, and σB is the Stefan-Boltzmann constant.

Thus, we can set up a differential equation for T' (the rate of change of temperature T) in terms of the specific heat C of cookie dough, the total power output of the sun Ps, and the shape and size of the dough ball. The shape and size come into play in several ways. First, more mass means higher heat capacity. Second, larger cross sectional area facing the sun means more heat absorbed. Third, larger surface area means more heat radiated away via blackbody radiation. Let's consider a spherical lump of cookie dough with the density of water, the specific heat of water, and a radius of 2 centimeters. I will also assume, for the sake of convenience, that the cookie dough is a perfect blackbody (i.e. that it completely absorbs all wavelengths of light). Of course, the validity of this assumption will depend on the type of cookie. A dark coloured cookie, like chocolate-chocolate chip, would be a more ideal blackbody than, say, peanut butter. But this would probably only change the answer by a factor of 2 or so.

The differential equation for temperature is:

Where r_c is the radius of the cookie, and A1 and A2 are calculated given the spherical shape of the cookie. Again, we can solve this numerically using Mathematica, with the initial condition T=275 K=2 C.

Typical cookie recipes involve a baking time of 10-15 minutes at about 200 degrees Celsius. So we will be looking for a trajectory that keeps the temperature well below this level, with the exception of the timespan.

First let's look at trajectories where we throw the cookie tangential to the Earth's orbit — that is, along or against the direction of the Earth's motion. Below is a plot of four such orbits. One very close to the Earth's orbit, two orbits that go closer to the sun, and one that goes very far from the sun. The second plot shows distance from the sun, r vs. time. The orbit that is close to circular stays at about the same distance, the orbit that goes very far away quickly goes off the scale of the plot, and the two closer-in orbits periodically approach the sun.

The third plot shows the resulting temperature as a function of time for these trajectories. As expected, the cookie dough that roughly follows the Earth's orbit stays around the Earth's temperature (about 0 degrees C). The orbit that goes far from the sun cools off towards absolute zero (-273 degrees C). The two that go closer to sun are what we're looking for, with a period of high temperatures.

Clearly, the blue curve gets too hot — the cookie would be terribly charred at 800 degrees C. The purple curve looks more promising, topping out at just over the target of 200 degrees C. The only problem, as you may notice, is that the timescale is in hundreds of thousands of minutes. So the amount of time it would take for the cookie to bake around 200 C would be on the order of days. Again, the cookie will be vastly overdone. This is a general problem — the timescales involved in orbits around the sun are typically on the order of a year, whereas the timescales involved in baking cookies are on the order of minutes.

One way to overcome this mismatch in timescales is to vastly shorten the time the cookie spends near the sun by hurling it past the sun at extraordinarily high speed(as in, a significant fraction of the speed of light). The figure below shows four such scenarios with different initial velocities, ranging from a tenth to a third the speed of light. In each case, the cookie is launched at an angle of 9 degrees away from the sun. Here, the trajectories are all on top of each other and look like completely straight lines. The cookie is going so fast in all cases that the the gravitational pull of the sun has little effect on the trajectory. The second plot again shows distance from the sun vs. time, and the third plot shows temperature vs. time. At the highest initial speed (10^8 m/s), things are starting to look promising. Here it takes about 10 minutes to heat up, stays around 200 C for about 10 minutes, and then cools down over the course of about 45 minutes. This is not too dissimilar from what happens when you bake a cookie.

It is possible that things could be improved by altering the geometry of the cookie. If you were to increase the total surface area of the cookie while keeping the cross-sectional area presented to the sun at a minimum, then the equilibrium temperature would be generally lower, and cooling would take place faster. For example, you could accomplish this by moulding the cookie dough into a shape with many narrow fins, like in a heat sink for electronics.

But let's be honest — who wants to eat a heat sink? Either way, good luck getting that cookie back.

Picture: Shutterstock/Michelangelus

*If you were to fling a scoop of cookie dough in space directly toward the sun, how long would it take the dough to turn into a fully baked cookie?***originally appeared on Quora. You can follow Quora on Twitter, Facebook, and Google+.**

*This answer has been lightly edited for grammar and clarity.*