The k.p perturbation method for determination of electronic structure first pioneered by Kohn and Luttinger continues to provide valuable insight to several band structure features. This method has been adapted to heterostructures confined in up to three directions. In this paper, numerical details of setting up a k.p Hamiltonian using the finite difference approximation for such confined nanostructures is explicitly demonstrated. Nanostructures belonging to two different symmetry classes, namely, the cubic zincblende and rhombohedral crystals are considered. Rhombohedral crystals, of late, have gained prominence as candidates for the recently discovered topological insulator (TI) class of materials. Lastly, the incorporation of a strain field to the k.p Hamiltonian and the corresponding matrix equations for computing the intrinsic and an externally applied strain in heterostructures within a continuum approximation is shown. Two applications are considered (1)Computation of the eigenstates of a multi-million zincblende InAs quantum dot with a stress-reducing InGaAs layer of varying Indium composition embedded in a GaAs matrix and (2) Dispersion of a rhombohedral TI Bi2Se3 film and the necessary alteration in presence of proximity-induced superconductivity.