Azimuthal anisotropies of muons from charm and bottom hadron decays are measured in Pb+Pb collisions at √ s NN = 5.02 TeV. The data were collected with the ATLAS detector at the Large Hadron Collider in 2015 and 2018 with integrated luminosities of 0.5 nb −1 and 1.4 nb −1 , respectively. The kinematic selection for heavy-flavor muons requires transverse momentum 4 < p T < 30 GeV and pseudorapidity |η| < 2.0. The dominant sources of muons in this p T range are semi-leptonic decays of charm and bottom hadrons. These heavy-flavor muons are separated from light-hadron decay muons and punch-through hadrons using the momentum imbalance between the measurements in the tracking detector and in the muon spectrometers. Azimuthal anisotropies, quantified by flow coefficients, are measured via the eventplane method for inclusive heavy-flavor muons as a function of the muon p T and in intervals of Pb+Pb collision centrality. Heavy-flavor muons are separated into contributions from charm and bottom hadron decays using the muon transverse impact parameter with respect to the event primary vertex. Non-zero elliptic (v 2) and triangular (v 3) flow coefficients are extracted for charm and bottom muons, with the charm muon coefficients larger than those for bottom muons for all Pb+Pb collision centralities. The results indicate substantial modification to the charm and bottom quark angular distributions through interactions in the quark-gluon plasma produced in these Pb+Pb collisions, with smaller modifications for the bottom quarks as expected theoretically due to their larger mass.