Is there a formula to calculate take off runway distance for commercial planes? I want to be able to calculate the take off runway distance that a plane needs depending on factors such as weight and plane size, etc. I know that graphs exist in the pilot handbook to do this but is there a specific formula that I could perhaps put into a program?
These calculations are quite complex because they take into consideration a lot of different variables, just off the top of my head:


Take off weight, which includes FOB
Runway length
Runway condition
Field elevation
Air temperature
Air pressure
Wind
Engine type and airplane configuration


Based on those (and I am sure many more), you have to calculate at minimum V1, VR and V2, and possibly others.

These calculations are looked up from a table.