import numpy as np


def pca(a: np.ndarray, center: bool = False, scale: bool = False):
    x = np.atleast_2d(a)

    if center:
        x -= x.mean(axis=0)
        if scale:
            x /= x.std(axis=0)

    u, d, vt = np.linalg.svd(x, full_matrices=False)

    return u * d, vt.T
