def pwm2rpm(pwm, pwm2rpm_scale, pwm2rpm_const):
    """Computes motor squared rpm from pwm.

    Args:
        pwm (ndarray): Array of length 4 containing PWM.
        pwm2rpm_scale (float): Scaling factor between PWM and RPMs.
        pwm2rpm_const (float): Constant factor between PWM and RPMs.

    Returns:
        ndarray: Array of length 4 containing RPMs.

    """
    rpm = pwm2rpm_scale * pwm + pwm2rpm_const
    return rpm