<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fromAttr(mid, ang, dist):
 """ create from middle, angle and distance """

    mx, my = mid
    dx = cos(ang) * dist * 0.5
    dy = sin(ang) * dist * 0.5
    return mx - dx, my - dy, mx + dx, my + dy