polliwog/segment/segment.py
def partition_segment(p1, p2, n_samples, endpoint=True):
    """
    For two points in n-space, return an np.ndarray of equidistant partition
    points along the segment determined by p1 & p2.

    The total number of points returned will be n_samples. When n_samples is
    2, returns the original points.

    When endpoint is True, p2 is the last point. When false, p2 is excluded.

    Partition order is oriented from p1 to p2.

    Args:
        p1, p2:
            1 x N vectors

        partition_size:
            size of partition. should be >= 2.

    """
    if not isinstance(n_samples, int):
        raise TypeError("partition_size should be an int.")
    elif n_samples < 2:
        raise ValueError("partition_size should be bigger than 1.")

    return (p2 - p1) * np.linspace(0, 1, num=n_samples, endpoint=endpoint)[
        :, np.newaxis
    ] + p1

    For two points in n-space, return an np.ndarray of equidistant partition
    points along the segment determined by p1 & p2.

    The total number of points returned will be n_samples. When n_samples is
    2, returns the original points.

    When endpoint is True, p2 is the last point. When false, p2 is excluded.

    Partition order is oriented from p1 to p2.

    Args:
        p1, p2:
            1 x N vectors

        partition_size:
            size of partition. should be >= 2.

    
For two points in n-space, return an np.ndarray of equidistant partition
points along the segment determined by p1 & p2.

The total number of points returned will be n_samples. When n_samples is
2, returns the original points.

When endpoint is True, p2 is the last point. When false, p2 is excluded.

Partition order is oriented from p1 to p2.
For two points in n - space return an np . ndarray of equidistant partition points along the segment determined by p1 & p2 . The total number of points returned will be n_samples . When n_samples is 2 returns the original points . When endpoint is True p2 is the last point . When false p2 is excluded . Partition order is oriented from p1 to p2 .
def partition_segment(p1, p2, n_samples, endpoint=True):
    if not isinstance(n_samples, int):
        raise TypeError("partition_size should be an int.")
    elif n_samples < 2:
        raise ValueError("partition_size should be bigger than 1.")
    return (p2 - p1) * np.linspace(0, 1, num=n_samples, endpoint=endpoint)[
        :, np.newaxis
    ] + p1
def partition_segment ( p1 , p2 , n_samples , endpoint = True ) : if not isinstance ( n_samples , int ) : raise TypeError ( "partition_size should be an int." ) elif n_samples < 2 : raise ValueError ( "partition_size should be bigger than 1." ) return ( p2 - p1 ) * np . linspace ( 0 , 1 , num = n_samples , endpoint = endpoint ) [ : , np . newaxis ] + p1
For two points in n-space, return an np.ndarray of equidistant partition
points along the segment determined by p1 & p2.
For two points in n - space return an np . ndarray of equidistant partition points along the segment determined by p1 & p2 .
"""
    For two points in n-space, return an np.ndarray of equidistant partition
    points along the segment determined by p1 & p2.

    The total number of points returned will be n_samples. When n_samples is
    2, returns the original points.

    When endpoint is True, p2 is the last point. When false, p2 is excluded.

    Partition order is oriented from p1 to p2.

    Args:
        p1, p2:
            1 x N vectors

        partition_size:
            size of partition. should be >= 2.

    """
p1
p2
n_samples
endpoint
p1, p2
1 x N vectors
1 x N vectors
partition_size
size of partition. should be >= 2.
size of partition . should be > = 2 .