How did scientists manage to find out the temperature of the sun?
There’s more than one way to find the sun’s temperature. You can measure the solar flux, how much radiation comes through a square meter sized “window” that is set perpendicular to the sun’s light. Then once you know both the distance between the Earth and the sun, and the radius of the sun, you can use the inverse square law to figure out what the flux would be on the surface of the sun. Then you multiply the square of the sun’s radius by 4 pi to get the surface area of the sun. And then you multiply the flux by the surface area to get the sun’s whole luminosity. With the luminosity and the radius of the sun, you use the Stefan-Boltzmann equation to get the surface temperature of the sun. When you calculate the temperature this way, you’re finding what astronomers call the “effective temperature.” The other way to do it is to measure the intensity of the sun’s light after it passes through a number of different filters that are designed to allow only certain wavelengths to pass. Usual