(f, rx, ry)
return octant, coord, neg
Get the circle octant for a given coordinate.
Get the circle octant for a given coordinate.
Get the circle octant for a given coordinate .
def _get_octant(f, rx, ry):
    """Get the circle octant for a given coordinate."""
    neg = f < 0.
    f = abs(f)
    octant = 0
    comp = math.pi / 4.
    while f > comp:
        comp += math.pi / 4.
        octant += 1
        if octant >= 8:
            raise error.BASICError(error.IFC)
    if octant in (0, 3, 4, 7):
        # running var is y
        coord = abs(int(round(ry * math.sin(f))))
    else:
        # running var is x
        coord = abs(int(round(rx * math.cos(f))))
    return octant, coord, neg
def _get_octant ( f , rx , ry ) : neg = f < 0. f = abs ( f ) octant = 0 comp = math . pi / 4. while f > comp : comp += math . pi / 4. octant += 1 if octant >= 8 : raise error . BASICError ( error . IFC ) if octant in ( 0 , 3 , 4 , 7 ) : # running var is y coord = abs ( int ( round ( ry * math . sin ( f ) ) ) ) else : # running var is x coord = abs ( int ( round ( rx * math . cos ( f ) ) ) ) return octant , coord , neg