shapelib/core.py
def line_extrapolate_point(l, p, length):
    """
    Return a Point p2 which would extend the line `l` so that it
    would have a length of `length`

    l: a line
    p: a point within that line
    length: the length that a line from p to p2 would have

    """
    p = Point(*_normalize_point(p))
    a = line_angle_at(l, p)
    if a > pi:
        a = a % pi
    p2 = Point(p.x, p.y + length)
    c = l.centroid
    if p.x < c.x:
        if p.y < c.y:
            angle = pi-a
        else:
            angle = a
    elif p.x > c.x:
        if p.y < c.y:
            angle = -a
        else:
            angle = -a
    else:
        if p.y < c.y:
            angle = a + pi
        elif p.y > c.y:
            angle = a % pi
        else:
            angle = 100
    p3 = rotate(p2, math.degrees(angle), origin=p)
    return p3

    Return a Point p2 which would extend the line `l` so that it
    would have a length of `length`

    l: a line
    p: a point within that line
    length: the length that a line from p to p2 would have

    
Return a Point p2 which would extend the line `l` so that it
would have a length of `length`

a line
p: a point within that line
length: the length that a line from p to p2 would have
Return a Point p2 which would extend the line ` l ` so that it would have a length of ` length ` a line p : a point within that line length : the length that a line from p to p2 would have
def line_extrapolate_point(l, p, length):
    p = Point(*_normalize_point(p))
    a = line_angle_at(l, p)
    if a > pi:
        a = a % pi
    p2 = Point(p.x, p.y + length)
    c = l.centroid
    if p.x < c.x:
        if p.y < c.y:
            angle = pi-a
        else:
            angle = a
    elif p.x > c.x:
        if p.y < c.y:
            angle = -a
        else:
            angle = -a
    else:
        if p.y < c.y:
            angle = a + pi
        elif p.y > c.y:
            angle = a % pi
        else:
            angle = 100
    p3 = rotate(p2, math.degrees(angle), origin=p)
    return p3
def line_extrapolate_point ( l , p , length ) : p = Point ( * _normalize_point ( p ) ) a = line_angle_at ( l , p ) if a > pi : a = a % pi p2 = Point ( p . x , p . y + length ) c = l . centroid if p . x < c . x : if p . y < c . y : angle = pi - a else : angle = a elif p . x > c . x : if p . y < c . y : angle = - a else : angle = - a else : if p . y < c . y : angle = a + pi elif p . y > c . y : angle = a % pi else : angle = 100 p3 = rotate ( p2 , math . degrees ( angle ) , origin = p ) return p3
Return a Point p2 which would extend the line `l` so that it
would have a length of `length`
Return a Point p2 which would extend the line ` l ` so that it would have a length of ` length `
"""
    Return a Point p2 which would extend the line `l` so that it
    would have a length of `length`

    l: a line
    p: a point within that line
    length: the length that a line from p to p2 would have

    """
l
p
length