We developed a novel contactless frequency-domain approach to study thermal transport, which is particularly convenient when thermally anisotropic materials are considered. The method is based on a similar line-shaped heater geometry as used in the 3-omega method, however, keeping all the technical advantages offered by non-contact methodologies. The present method is especially suitable to determine all the elements of the thermal conductivity tensor, which is experimentally achieved by simply rotating the sample with respect to the line-shaped optical heater. We provide the mathematical solution of the heat equation for the cases of anisotropic substrates, multilayers, as well as thin films. This methodology allows an accurate determination of the thermal conductivity, and does not require complex modeling or intensive computational efforts to process the experimental data, i.e., the thermal conductivity is obtained through a simple linear fit (slope method), in a similar fashion as in the 3-omega method. We demonstrate the potential of this approach by studying isotropic and anisotropic materials in a wide range of thermal conductivities. In particular, we have studied the following inorganic and organic systems: (i) glass, Si, and Ge substrates (isotropic), (ii) $beta$-Ga$_2$O$_3$, and a Kapton substrate (anisotropic) and , (iii) a 285 nm SiO$_2$/Si thin film. The accuracy in the determination of the thermal conductivity is estimated at $approx$ 5%, whereas the best temperature resolution is $Delta$T $approx$ 3 mK.