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
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