How to calculate the electromagnetic strength between an iron piece and an electromagnet IF both of them are not parallel?
This problem is pretty complex.  There is no simple equation to solve a problem like this. It would involve a lot of 3d, surface,line integrals, and differential equations to solve it by hand. This would be graduate level mathematics, and not something you learn in undergraduate studies.

If you want an accurate approximation, I would suggest using an electromagnetic simulation software such as Ansys Electromagnetics. 

Learning to use these softwares are much more practical and will help you in the long run. Hopefully this helps.