sc2simulator/setup/mapLocations.py
def pickFurtherLoc(location, length):
    """picks a location 'length' distance toward the center from 'location'"""
    global mapDimensions
    dims = mapDimensions[:2]
    x, y = location[:2]
    if length == 0: # no need to calculate delta from location
        return (x, y)
    xMid, yMid = [i / 2.0 for i in dims]
    theta = math.atan2(yMid - y, xMid - x)
    newX = x - math.cos(theta) * length
    newY = y - math.sin(theta) * length
    return (newX, newY)
picks a location 'length' distance toward the center from 'location
picks a location 'length' distance toward the center from 'location
picks a location ' length ' distance toward the center from ' location
def pickFurtherLoc(location, length):
    global mapDimensions
    dims = mapDimensions[:2]
    x, y = location[:2]
    if length == 0: 
        return (x, y)
    xMid, yMid = [i / 2.0 for i in dims]
    theta = math.atan2(yMid - y, xMid - x)
    newX = x - math.cos(theta) * length
    newY = y - math.sin(theta) * length
    return (newX, newY)
def pickFurtherLoc ( location , length ) : global mapDimensions dims = mapDimensions [ : 2 ] x , y = location [ : 2 ] if length == 0 : return ( x , y ) xMid , yMid = [ i / 2.0 for i in dims ] theta = math . atan2 ( yMid - y , xMid - x ) newX = x - math . cos ( theta ) * length newY = y - math . sin ( theta ) * length return ( newX , newY )
picks a location 'length' distance toward the center from 'location
picks a location ' length ' distance toward the center from ' location
"""picks a location 'length' distance toward the center from 'location'""" # no need to calculate delta from location
location
length