I'm working on a project which uses cylindrical permanent magnets, and I'm trying to determine the expected magnetic field due to these magnets. One problem I run into is that these magnets are usually not completely horizontal above the point at which I want to calculate the expected magnetic field. Assuming the point is on the axis of the cylinder, it's easy enough to calculate the expected magnetic field using the following equation: B=Br2[D+zR2+(D+z)2zR2+z2]B = \frac{B_r}{2}\left[\frac{D + z}{\sqrt{R^2+(D+z)^2}} - \frac{z}{\sqrt{R^2+z^2}}\right] where BrB_r is the remanence field (found in a magnet's data sheet), zz is the distance from a face of the cylinder on the axis, DD is the thickness of the magnet, and RR is the radius of the cylinder. However, this equation only works on the axis of the cylinder itself. How can I calculate the off-axis magnetic field for a cylindrical permanent magnet? Note: I don't particularly need the derivation for the off-axis equation for now, although it would definitely be helpful.