Mohammed Ghomi's answeranswer reminds me of a related picture that Cedric Villani drew to depict Ricci curvature ([1] Chapter 14). Similar to the $CAT(\kappa)$$\operatorname{CAT}(\kappa)$ inequality, this idea can be used to derive notions of Ricci curvature for more general metric measure spaces.
[1] Villani, Cédric, Optimal transport. Old and new, Grundlehren der Mathematischen Wissenschaften 338. Berlin: Springer (ISBN 978-3-540-71049-3/hbk). xxii, 973 p. (2009). ZBL1156.53003.