The discrete and continuous formulas can be derived now.
The depth control is ready to be implemented.