Added rotation()

Added function to calculate the rotation of a triangle. Computes the
direction in which the triangle is pointing, expressed in degrees.