A straight wire segment is placed in a region known to contain a constant magnetic field of unknown strength. A current of 6 A runs through the wire, which can be turned in various directions until the force per unit length acting on it takes on a maximum value of 0.18 N/m. What is the value of the magnetic field?