Capacitive displacement method to determine the longitudinal piezoelectric coefficients of single crystals, ceramics and thin films