Finding IFS Rules from Images of Points

Background: Angles

Recall the angles theta and phi are defined by
tan(theta) = c/a tan(phi) = -b/d
Because arctan is single-valued between -90 and 90, theta = arctan(c/a) and phi = arctan(-b/d) defines the angles in that range.
By considering the signs of a and c, we can extend the range of theta to (-180,180]. If a > 0, then theta = arctan(c/a).
If a = 0 and c > 0, then theta = 90. If a < 0 and c > 0, note tan(c/a) = tan(-c/-a) and (-a,-c) lies in the range where arctan(-c/-a) can be computed. So theta = arctan(-c/-a) + 180. If a = 0 and c < 0, then theta = -90. If a < 0 and c < 0, note tan(c/a) = tan(-c/-a) and (-a,-c) lies in the range where arctan(-c/-a) can be computed. So theta = arctan(-c/-a) - 180.
A similar analysis gives
If d > 0, phi = arctan(-b/d). If d = 0 and b < 0, phi = 90. If d < 0 and b < 0, phi = arctan(-b/d) + 180. If d = 0 and b > 0, phi = -90. If d < 0 and b > 0, phi = arctan(-b/d) - 180

Return to Convering to IFS Parameters.