A one-dimensional continuum model for calculating strain and electric field in wurtzite semiconductor heterostructures with arbitrary crystal orientation is presented and applied to GaN/AlGaN and ZnO/MgZnO heterostructure combinations. The model is self-consistent involving feedback couplings of spontaneous polarization, strain, and electric field. Significant differences between fully coupled and semicoupled models are found for the longitudinal and shear-strain components as a function of the crystal-growth direction. In particular, we find that the semicoupled model, typically used in the literature for semiconductors, is inaccurate for ZnO/MgZnO heterostructures where shear-strain components play an important role. An interesting observation is that a growth direction apart from [1¯21¯0] exists for which the electric field in the quantum well region becomes zero. This is important for, e.g., optimization of light-emitting-diode quantum efficiency.