I've been using various formulas when I make families in Revit. They usually make my work easier, but make me crazy at the same time. I always try to use formulas as little as possible. (I'm not that math guy)
And here is one of the tips to get rid of formulas.
Folding Structure
To make a family like folding doors those enable to close and open, Pythagorean theorem can be used for it like this