Period and amplitude of a function