6. Electric Dipole Field/Potential Analyzer
Computes dipole potential and field for a dipole moment \( \mathbf{p}=q\,\mathbf{d} \). Far-field (point dipole) uses \( \mathbf{E}(\mathbf{r})=\dfrac{1}{4\pi\varepsilon}\dfrac{1}{r^3}\big(3(\mathbf{p}\cdot\hat{\mathbf{r}})\hat{\mathbf{r}}-\mathbf{p}\big) \) and \( V(\mathbf{r})=\dfrac{1}{4\pi\varepsilon}\dfrac{\mathbf{p}\cdot\mathbf{r}}{r^3} \). Also includes an exact two-charge model for visualization and torque in a uniform external field.
pi, e, sqrt(), sin, cos, exp, log. Use * for multiplication.