(self, min_angle=100, max_angle=80, min_radius=0.0, max_radius=1.0)
Converts a planar layout to a radial one

        This method applies only to 2D layouts. The X coordinate of the
        layout is transformed to an angle, with min(x) corresponding to
        the parameter called I{min_angle} and max(y) corresponding to
        I{max_angle}. Angles are given in degrees, zero degree corresponds
        to the direction pointing upwards. The Y coordinate is
        interpreted as a radius, with min(y) belonging to the minimum and
        max(y) to the maximum radius given in the arguments.

        This is not a fully generic polar coordinate transformation, but
        it is fairly useful in creating radial tree layouts from ordinary
        top-down ones (that's why the Y coordinate belongs to the radius).
        It can also be used in conjunction with the Fruchterman-Reingold
        layout algorithm via its I{miny} and I{maxy} parameters (see
        L{Graph.layout_fruchterman_reingold()<igraph._igraph.GraphBase.layout_fruchterman_reingold()>})
        to produce radial layouts where the radius belongs to some property of
        the vertices.

        @param min_angle: the angle corresponding to the minimum X value
        @param max_angle: the angle corresponding to the maximum X value
        @param min_radius: the radius corresponding to the minimum Y value
        @param max_radius: the radius corresponding to the maximum Y value
Converts a planar layout to a radial one
Converts a planar layout to a radial one
def to_radial(self, min_angle=100, max_angle=80, min_radius=0.0, max_radius=1.0):
        """Converts a planar layout to a radial one

        This method applies only to 2D layouts. The X coordinate of the
        layout is transformed to an angle, with min(x) corresponding to
        the parameter called I{min_angle} and max(y) corresponding to
        I{max_angle}. Angles are given in degrees, zero degree corresponds
        to the direction pointing upwards. The Y coordinate is
        interpreted as a radius, with min(y) belonging to the minimum and
        max(y) to the maximum radius given in the arguments.

        This is not a fully generic polar coordinate transformation, but
        it is fairly useful in creating radial tree layouts from ordinary
        top-down ones (that's why the Y coordinate belongs to the radius).
        It can also be used in conjunction with the Fruchterman-Reingold
        layout algorithm via its I{miny} and I{maxy} parameters (see
        L{Graph.layout_fruchterman_reingold()<igraph._igraph.GraphBase.layout_fruchterman_reingold()>})
        to produce radial layouts where the radius belongs to some property of
        the vertices.

        @param min_angle: the angle corresponding to the minimum X value
        @param max_angle: the angle corresponding to the maximum X value
        @param min_radius: the radius corresponding to the minimum Y value
        @param max_radius: the radius corresponding to the maximum Y value
        """
        if self._dim != 2:
            raise TypeError("implemented only for 2D layouts")
        bbox = self.bounding_box()

        while min_angle > max_angle:
            max_angle += 360
        while min_angle > 360:
            min_angle -= 360
            max_angle -= 360
        while min_angle < 0:
            min_angle += 360
            max_angle += 360

        ratio_x = (max_angle - min_angle) / bbox.width
        ratio_x *= pi / 180.0
        min_angle *= pi / 180.0
        ratio_y = (max_radius - min_radius) / bbox.height
        for idx, (x, y) in enumerate(self._coords):
            alpha = (x - bbox.left) * ratio_x + min_angle
            radius = (y - bbox.top) * ratio_y + min_radius
            self._coords[idx] = [cos(alpha) * radius, -sin(alpha) * radius]
def to_radial ( self , min_angle = 100 , max_angle = 80 , min_radius = 0.0 , max_radius = 1.0 ) : if self . _dim != 2 : raise TypeError ( "implemented only for 2D layouts" ) bbox = self . bounding_box ( ) while min_angle > max_angle : max_angle += 360 while min_angle > 360 : min_angle -= 360 max_angle -= 360 while min_angle < 0 : min_angle += 360 max_angle += 360 ratio_x = ( max_angle - min_angle ) / bbox . width ratio_x *= pi / 180.0 min_angle *= pi / 180.0 ratio_y = ( max_radius - min_radius ) / bbox . height for idx , ( x , y ) in enumerate ( self . _coords ) : alpha = ( x - bbox . left ) * ratio_x + min_angle radius = ( y - bbox . top ) * ratio_y + min_radius self . _coords [ idx ] = [ cos ( alpha ) * radius , - sin ( alpha ) * radius ]