iammix / biaxialPy

Biaxial Load analysis for concrete sections
0 stars 0 forks source link

Sort list of angles in clockwise order #1

Closed github-actions[bot] closed 3 years ago

github-actions[bot] commented 3 years ago

Sort list of angles in clockwise order

https://github.com/iammix/biaxialPy/blob/6fde8133381a4fd6853573d15721b59c0edfc643/src/geometry.py#L155


    Cx, Cy = polygon_centroid(x_section_vertices, y_section_vertices)

    a0 = []
    for i in range(len(x_t)):
        a0.append(atan2((y_t[i] - Cy), (x_t[i] - Cx)) * 180 / pi)
    if counterclockwise:
        pos = [p for p in a0 if p >= 0]
        neg = [n for n in a0 if n < 0]
        a = pos + [360 + angle for angle in neg]

        idx = sorted(range(len(a0)), key=lambda j: a0[j], reverse=False)
        a = sorted(a)
    else:
        # TODO: Sort list of angles in clockwise order
        pass

82b520016b61b3c30139e76a6d6dadcee2ba2252

iammix commented 3 years ago

In order_polygon_vertices create the clockwise sorting biaxialPy/src/geometry.py

github-actions[bot] commented 3 years ago

Closed in be17b7104c8d93b878c3fbae4b414b00a48c1782