I don't "know" the exact answer to your question but if I were in your shoes I would take the measure of the outside edge of the sheet after I removed the existing elastic. Then I would measure the distance on the side of the mattress and the end of the mattress where I expected the wrapped under edges of the fitted sheet to lie when the elastic is back in place. Let's say that the fitted sheet ought to wrap under the mattress 3". I'd measure in 3" from the edge of the top of the mattress and then take the length that far in along the side of the mattress and also along the end of the mattress. Since a sheet is basically a rectangle, you can add the side measurement to the end measurement and multiply by 2 to get the entire perimeter measurement. This measurement is probably a good estimate of the amount of elastic you are going to need.
For the long straight sections, you'll probably want the elastic to be 1 or 2 " SHORTER for each lineal foot of distance so that it "shrinks" to hold a nice line as the sheet is pulled under the mattress. Where the sheet needs to pull under at the corners, you need much more "shrinkage" out of the elastic. Measure (on the top of the mattress) the curve where you expect the elastic to lie when the fitted sheet is in place so you know how long that curve is. (Write that number down because you'll use it 4 times when it comes to applying your elastic.) Your elastic cannot be any longer in that area than the curve you measured if it is going to hold the sheet in place. Compare the length you measured for the "curve" to the length of the corresponding area on your existing queen-sized fitted sheet. If the first measurement is 12" and the second one is 24", you know you need to stitch 2 inches of sheet to one inch of elastic to get the amount of "shrink" you need in that area.
Mark a starting place (like with a permanent marker) about 6 inches from the end of your elastic and decide if you want to begin applying the elastic at the middle of a long side or a short end of the sheet. On the mattress top at the place where the imaginary line runs (in my example, 3" in from the edge), measure from the midpoint down to the point where the "curve" will start. Subtract 1" to 2" (your choice) from each FOOT in that measurement to get the length of the elastic you'll need to that point. Write that number down because you'll use it again. Measure your elastic from the first permanent marker "starting place" the length you just calculated and make a second permanent marker mark. From that second mark, measure the distance that equals your "curve" measurement and make a third permanent marker mark. Now measure the next run of imaginary line from where the first "curve" ends to where the next "curve" starts and subtract 1" to 2" from each FOOT of that measurement. Write that number down because you'll use it again. Transfer your calculation to the elastic to find where the fourth permanent marker mark should be placed. Use your "curve" measurement to mark a fifth permanent marker mark on your elastic.
You've now marked out sufficient elastic to deal with half of one side, all of another side, and two corners of your sheet. Go back to the measurement you calculated for that first half side and double it (because you'll be putting elastic along the entire side of the sheet opposite where you started). Make a sixth permanent marker mark on your elastic that distance from the fifth mark. The seventh mark will be the end point for the elastic when it finishes the third "curve". The eighth mark will be placed the same distance that you used for the opposite continuous side (so it defines the beginning of the fourth and final "curve"). The ninth mark will mark the length of the last "curve". And the 10th mark will be equal to the length you first wrote down (because it is the amount of elastic needed to finish off the half-side where you started).
You are now ready to apply your elastic. Working with the elastic on the WRONG side of the sheet and allowing at least 3/8" between the edge of the sheet and the elastic (because you'll need to turn this raw edge under eventually), SECURELY tack your elastic to the sheet where you're going to start so you can use both hands to guide the sheet and the elastic at this crucial point. Use a zig zag stitch with a fairly long stitch length to stich the elastic to the sheet. If it helps you manage the stretching operation, pin or otherwise mark both the sheet and the elastic in quarters or thirds or halves of the distance from one permanent marker mark to another. Then pull the elastic enough so that it lies flat to the sheet while you stitch (but relaxes to form gathers behind the sewing machine foot). When you need to stop to shift hand positions, put the needle DOWN through the elastic and sheet, get yourself ready for the next batch of stitching, and start the machine up again. When you get back to your starting point, undo the security tack and cut the elastic so that the two ends can abut. Put a piece of ribbon or other closely woven fabric behind the elastic where the ends touch each other and stitch to secure the elastic to the stabilizing fabric in a nice flat, strong "join". Your elastic is applied. Just turn the edge of the sheet under so there are no exposed cut threads and run a regular straight stitch to secure it.
Both replies are great advice. Another idea is to look in your linen closet to see if you have a fitted sheet that fits like you like it to........
I'm really partial to the sheets that have looser elastic (not something really tight) that goes around the entire sheet, instead of just the corners.
I'd measure something I liked the fit of, and copy the amount of elastic in it. I'm not a math genius so this type of copying works for me. No need to re invent something that is already working. I do replace elastic in clients sheets that has given up. I have never thought about coming up with a formula. But, my elastic is in bulk here, so I just use from the spool at the end of my sewing table and go until I meet myself back at the beginning.
Works for me!