To calculate, you need to determine these conditions.
For example, an object, such as a bamboo pole, stands upright on the flat ground, the date is summer solstice, and it is located on the tropic of cancer.
The calculation method is that different times correspond to different solar altitude angles α,
Shadow length L= 1*cos a
This a is related to both date and time and latitude.
I hope I can help you.