예제 #1
0
    def __init__(self, previous, current):
        """
        Constructor
        """

        self.position = previous
        self.vector = TupleMath.unit(TupleMath.subtract(current, previous))
        self.angle = 0.0
        self.tangent = self.vector
예제 #2
0
    def set_vector(self, vector):
        """
        Set the vector of the axis, converting it to unit length
        Also calculates axis end points
        """

        if vector:
            vector = TupleMath.unit(vector)

        self.vector = vector

        if not self.vector:
            return