This is a question I have after listening to a lecture.
def gosperize(curve): scaled_curve = scale(sqrt(2)/2)(curve) left_curve = rotate(pi/4)(scaled_curve) right_curve = translate(0.5,0.5)(rotate(-pi/4)(scaled_curve)) return connect_rigidly(left_curve, right_curve) def gosper_curve(level): return repeated(gosperize, level)(curve) def identity(x): return x def repeated(f, n): if (n == 0): return identity return composed(f, repeated(f, n-1)) def rotate(angle): def transform(curve): def rotated_curve(t): pt = curve(t) x, y = x_of(pt), y_of(pt) cos_a, sin_a = cos(angle), sin(angle) return make_point(cos_a*x - sin_a*y, sin_a*x + cos_a*y) return rotated_curve return transform def joe_rotate(angle): def transform(curve): def rotated_curve(t): x, y = x_of(curve(t)), y_of(curve(t)) cos_a, sin_a = cos(angle), sin(angle) return make_point(cos_a*x - sin_a*y, sin_a*x + cos_a*y) return rotated_curve return transform
I think this is all the code that is needed to contextualise my question properly. The lecture was on an abstraction on curves. It was mentioned that for the function
joe_rotate is used instead of
gosper_curve will turn into a process whose time is linear in the level into one which is exponential in the level. I do not understand how assigning
pt=curve(t) could change the time complexity of the function. I would appreciate any help on my order of growth fundamentals.