from .pturtle import *

RAD_GOLDEN = 2.39996322972865

class RPTurtle(PTurtle):
    """ Rotate Polygon Turtle.

        A polygon turtle that rotates around the walking axis by a given angle when walking forward. The default angle of rotation is the golden angle.
    """
    
    def __init__(self, pos=None, orient=None, v_t=0, angle=RAD_GOLDEN, radians=True):
        super().__init__(pos, orient, v_t)
        if radians is False:
            angle = math.radians(angle)
        self.rad = angle
    def wf(self, dist):
        rot = mathutils.Quaternion((1, 0, 0), self.rad)
        self.rot(rot)
        super().wf(dist)
