Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Task 1
- // Part 1
- // unit_line_at : Number → Point
- // Part 2
- function vertical_line(pt, length){
- var x_new = x_of(pt);
- return function(t) {
- return make_point(x_new,
- y_of(pt) + length * t);
- };
- }
- // Part 3
- // vertical_line : (Point, Number) → Point
- // Part 4
- // (draw_connected(200))(vertical_line(make_point(0.5, 0.25), 0.5));
- // Task 2
- /*
- Short answer: Symmetricity
- Longer answer: The points start out dense and become thinner in
- alternative_unit_circle while in unit_circle, they are evenly spaced.
- From the implementation of the two functions, we have
- x = sin(theta) and y = cos(theta), which is the parametric equation of a circle.
- If we think of t as time, the pen moves in a circular path but with
- different speed in the two cases.
- In unit_circle, theta varies linearly to t (constant speed, physics stuff)
- so the points are evenly spaced.
- In alternative_unit_circle, theta is directly proportional to time squared,
- which means the larger t gets, the faster the pen moves
- (constant positive linear acceleration, physics stuff again).
- Thus the increasingly sparse points in the alternative version.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement