Estimation is an art best practiced with a bit of math
The book "Software Estimation: Demystifying the Black Art" written by Steve McConnell in 2006 is an excellent place to start if you are doing software engineering estimates. It covers many methods and the material is presented in a very pragmatic way.
SnapEng F Effort Profiler is not especially tune for software engineering efforts, but it got it start in this field. The math inside the tool is based around the formula for the area of a triangle.