top of page
Writer's pictureAlina Liu

Week 5: Function

This week we learned about creating our own function, and therefore organize the code better. For the sketch, I decided to do a landscape portrait with lots of repetition. In the first version (which I forgot to save...), I hardcode all (x1, y1, x2, y2, x3, y3) for the mountains. And after I did that, I realize the y2 and y3 were the same because they were on one horizontal line, and the x2 and x3 were in relation to x1, because they were isosceles triangles. Then I did the second version, in which I summarize (x1, y1, x2, y2, x3, y3) to (x1, y1, x1+h/2, y+h, x1-h/2, y+h). So when calling the function, I only need to put in x, y and height.


Here is the link to the sketch 🔗


13 views0 comments

Recent Posts

See All

Comments


Post: Blog2_Post
bottom of page