Humans employ diagrams and other pictures, both real and imagined, as aids to reasoning, and many kinds of problems are solved by an interaction between perception-like processing and verbal reasoning. My research is exploring computational explanations of this interaction. The use of diagrams is in part a form of spatial reasoning, which is the use of representations of objects in space for problem-solving, inferring, and learning. I hypothesize that there are forms of representation that aid human reasoning by providing psychologically and computationally efficient ways of capturing and propagating the constraints of both real world events and mathematical abstractions. The creation, modification and transformation of these representations allow a person to perform mental experiments that make deductions and test conjectures about the corresponding physical situations and mathematical relations.