Beispiel #1
0
def get_angle_from_radius(num, radius):
    origin = PointedVector(0.0, 0.0, 0.0)
    p1 = origin.advance(radius)
    p2 = origin.turn(2 * math.pi / float(num)).advance(radius)
    ray_line = origin.to_line().reverse()
    side_line = p1.to_point().line_to(p2.to_point())
    angle = ray_line.angle_with(side_line, intersection=p1)
    return 2.0 * angle
Beispiel #2
0
def get_side_from_radius(num, radius):
    origin = PointedVector(0.0, 0.0, 0.0)
    p1 = origin.advance(radius)
    p2 = origin.turn(2 * math.pi / float(num)).advance(radius)
    side = p1.to_point().distance(p2.to_point())
    return side