I have two points: A and B. I know how to calculate the angle between the two points and create a line.
func angle(p1: CGPoint, p2: CGPoint) -> CGFloat{