import math


def xy2polar(points):
    """
    convert position in xy-coordinate sys. to r-theta one

    Args:
        points (list) : list of adsk.core.Point3D
    Returns:
        list: distances from origin
        list: angles from x-axis
    """
    distances = []
    angles = []
    count = len(points)
    for i in range(0, count):
        distances.append(math.sqrt(
            points[i].x * points[i].x + points[i].y * points[i].y))
        angles.append(
            math.atan2(points[i].y, points[i].x))

    return distances, angles