$${\begin {array} {l} s = (p\, cos(\theta) + r) \cdot t \\ s = (p\, cos(\theta) + r) \cdot \frac {2p} {g} sin(\theta) \\ s = \frac {2p^2} {g} cos(\theta)\, sin(\theta) + \frac {2pr} {g} sin(\theta) \end {array}}$$