This paper deals with a method of calculating the self and mutual inductances of various air coils located arbitrarily in space. Known elementary solutions (the Biot-Savart formulas) were used to determine the magnetic field of infinitely thin current loops and infinitely thin wires of finite length linking magnetically other coils. Unlike commonly used algorithms, these elementary solutions were not extensively transformed analytically but were used to perform calculations by direct numerical integration. This enabled very quick and accurate obtaining of the self-inductance values as well as determining the dependence of mutual inductances on the position of both coils. This method allows analysis of different coil configurations (misaligned coils, inclined to each other, etc.) that other methods do not cover. It also enables the determination of the forces acting on the coils, as well as the calculation of the magnetic field distribution from any coil configuration. The obtained results were compared with those presented by other authors.