Context. After matter distribution and kinematics, the bar or spiral pattern speeds are the next fundamental parameters determining the dynamics of a galaxy. Aims. New or refined methods for determining instantaneous scalar and vector pattern speeds from a restricted domain are developed for applications in N-body simulations or in galaxies such as the Milky Way, for which the stellar coordinates become increasingly better known. Methods. The general feature used throughout follows from the fact that the time derivative of a function of the coordinates is linearly proportional to its rotation rate and its particle velocities. Knowing these therefore allows retrieving the instantaneous pattern speed vector by linear optimization. Similarly, if an invariant function depends on the position and velocities, then its instantaneous rotation vectors in space can be retrieved. Knowing the accelerations also allows determining the pattern rotation of velocity space. Results. The first three methods are based on the assumed rotational invariance of functions at each point in space or velocity space: 1) The 6D invariant function method, measuring the pattern speed vectors in space and velocity space, 2) the differential/regional 3D Tremaine-Weinberg method, evaluated over regions with a high signal-to-noise ratio, 3) the 3D Jacobi integral method, yielding the potential pattern speed. Extensions to derive the rotation center position, speed, and acceleration are introduced in the first and third methods. The last two methods are based on the assumed invariance of average functions of the particle coordinates: 4) The 2D and 3D moment of inertia methods by using the derivative of the singular value decomposition, 5) the 2D Fourier method (3D for m = 2 mode), giving the mode rotation speeds. Pattern speed accelerations are also derived in the fourth and fifth methods. Conclusions. Depending on the available data in specific problems, the different methods provide a choice of approaches.