Given two opposite corners of the image in map coordinates you get the upper-left corner by taking the lesser easting (longitude) and the greater northing (latitude) of the pair.

Subtract the coordinates of opposite sides and you get the x and y dimension of the image in map coordinates. Divide those by the x and y size, respectively, of the image pixel size, and you have the size of each pixel in map coordinates. Then, because the specification says that the coordinates in the world file are of the center of the upper-left pixel, you need to add 1/2 the pixel size to that coordinate (I'm assuming that the coordinates entered are the absolute edge of the image, but a 1/2 pixel difference probably will make no difference.)

If you look at the source code on this page (Ctrl-U in a desktop browser), you'll see the javascript code around line 220. The main bit after reading the values from the input form is:

var ppx = (lon1 - lon2) / xsize ;

if (lat1 > lat2) {

var t = +lat1 ;

lat1 = lat2 ;

lat2 = t ;

}

var ppy = (lat1 - lat2) / ysize ;

lon2 += (ppx / 2) ; // x center of pixel

lat2 += (ppy / 2) ; // y center of pixel

var wf = ppx.toString() + "\n" +

"0.00000\n0.00000\n" +

ppy.toString() + "\n" +

lon2.toString() + "\n" +

lat2.toString() ;

ppx and ppy are the pixel sizes, x and y, in map coordinates. xsize and ysize are the size of the image in pixels in the two dimensions.

It makes no difference whether you're working in latitude and longitude or projected units like UTM; the math work out the same because the input and output are in the same coordinate system.

]]>thank you for any information.

Trying to calculate or to find formulas for a long time ]]>