Gravity and magnetic fields of polygonal prisms and application to magnetic terrain corrections | Synapse