"""Random points in various topologies."""

import numpy as np


def on_sphere():
    """Uniform sample on unit sphere.unit

    Uses Muller method."""
    vec = np.random.standard_normal(3)
    return vec / np.linalg.norm(vec)


def in_disk():
    """Uniform sample in unit circle."""
    sample = np.random.random_sample(2)
    a, b = sample.sort()
    return np.array([b * np.cos(2 * np.pi * a / b),
                     b * np.sin(2 * np.pi * a / b)])


def in_square():
    """Uniform sample in unit square."""
    return np.random.random_sample(size=2)

80288dfb2357947b73cd1e0cbb212ef36f836c6f
<mask token>


def on_sphere():
    """Uniform sample on unit sphere.unit

    Uses Muller method."""
    vec = np.random.standard_normal(3)
    return vec / np.linalg.norm(vec)


<mask token>

<mask token>


def on_sphere():
    """Uniform sample on unit sphere.unit

    Uses Muller method."""
    vec = np.random.standard_normal(3)
    return vec / np.linalg.norm(vec)


<mask token>


def in_square():
    """Uniform sample in unit square."""
    return np.random.random_sample(size=2)

<mask token>


def on_sphere():
    """Uniform sample on unit sphere.unit

    Uses Muller method."""
    vec = np.random.standard_normal(3)
    return vec / np.linalg.norm(vec)


def in_disk():
    """Uniform sample in unit circle."""
    sample = np.random.random_sample(2)
    a, b = sample.sort()
    return np.array([b * np.cos(2 * np.pi * a / b), b * np.sin(2 * np.pi *
        a / b)])


def in_square():
    """Uniform sample in unit square."""
    return np.random.random_sample(size=2)

<mask token>
import numpy as np


def on_sphere():
    """Uniform sample on unit sphere.unit

    Uses Muller method."""
    vec = np.random.standard_normal(3)
    return vec / np.linalg.norm(vec)


def in_disk():
    """Uniform sample in unit circle."""
    sample = np.random.random_sample(2)
    a, b = sample.sort()
    return np.array([b * np.cos(2 * np.pi * a / b), b * np.sin(2 * np.pi *
        a / b)])


def in_square():
    """Uniform sample in unit square."""
    return np.random.random_sample(size=2)

"""Random points in various topologies."""

import numpy as np


def on_sphere():
    """Uniform sample on unit sphere.unit

    Uses Muller method."""
    vec = np.random.standard_normal(3)
    return vec / np.linalg.norm(vec)


def in_disk():
    """Uniform sample in unit circle."""
    sample = np.random.random_sample(2)
    a, b = sample.sort()
    return np.array([b * np.cos(2 * np.pi * a / b),
                     b * np.sin(2 * np.pi * a / b)])


def in_square():
    """Uniform sample in unit square."""
    return np.random.random_sample(size=2)
