|
||||||||||||||||||||||||||||||||||||||||||
Problem Set 3: Tessellation Assigned: Saturday February 6, 2016 Due: Thursday February 11, 2016, midnight Points: 9 up to 12 Points This is a solo problem set, you are expected to work on your own on this problem set. Download the harness code.
Part 1 (6 Points Total)discount (1 Point)Write a function discount : int -> float such that a call (discount age) returns a percentage discount depending on the age. Kids (under age 13) get in free (i.e., a 100% discount), people otherwise under the age of 25, but not 19 year olds, receive a 20% discount, seniors >= 65 receive a 30% discount. Otherwise your discount is 0%.firstFactor (1 Point)Write a function firstFactor : int -> int such that a call (firstFactor n) returns the smallest integer factor of n that is greater than 1. For example, (firstFactor 5) is 5 and (firstFactor 323) is 17.Approximations of Euler's Number (2 Points)The number e is an important mathematical constant that is the base of the natural logarithm. It is approximately equal to 2.71828, and is the limit of $(1 + 1/n)^n$ as $n$ approaches infinity, an expression that arises in the study of compound interest. It can also be calculated as the sum of the infinite series \[ e = \displaystyle\sum\limits_{n = 0}^{ \infty} \dfrac{1}{n!} = 1 + \frac{1}{1} + \frac{1}{1\cdot 2} + \frac{1}{1\cdot 2\cdot 3} + \cdots \] Write a function euler : int -> float such that a call (euler n) returns the nth approximation of Euler's number. Note that (euler 0) should return 1, (euler 1) should return 2, and so forth.isPerfect (2 Points)An integer n is perfect if it is equal to the sum of its proper factors. For example, 6 is perfect because 6 = 3 + 2 + 1 and 28 is perfect because 28 = 14 + 7 + 4 + 2 + 1. Write a function isPerfect : int -> bool such that a call (isPerfect n) returns true if n is a perfect number and false otherwise.Part 2 Tessellation (3 Points up to 6 Points)According to the OED, the word tessellate means To make into a mosaic; to form a mosaic upon, adorn with mosaics; to construct (esp. a pavement) by combining variously coloured blocks so as to form a pattern..Tessellation was raised to a high art in Persian and Islamic architecture which featured spectacular tessellated structures.
The 16/17th century German mathematician and astronomer (and astrologer) Johannes Kepler studied tessellation. In 1619 he published Harmonices Mundi (The Harmony of the World) which investigated the mathematical properties of semi-regular (or so-called Archimedian) tessellations. The mathematical properties of tilings remains an active field of study today. See here, here and here. The stunning tilings at Alhambra date from the 12th century. Some are shown below.
MC EscherThe Alhambra examples are notable because of the complex interplay between foreground and background. This proved to be especially interesting to the 20th century Dutch artist MC Escher whose famous work was largely inspired by a 1922 visit to Alhambra.
Your PartWe have posted a simple tessellation with squares.
Part A (3 Points) Ring TessellationWrite a function ringTiling : int -> Image.t such that given a call (ringTiling n), returns an image with n2 rings as shown in Figure Ring Tiling above. Each ring should have the same radius but both the width and the color of the ring should be random.Part B (6 Points) Hex TessellationA regular hexagon is a 6-sided figure with all sides of equal length and all interior angles equal (120 degrees). Like an equilateral triangle, a square and a regular pentagon, a regular hexagon is a regular polygon.The Universe library's Image module includes a function val polygon : (float * float) list -> Color.t -> Image.t which can be used to draw polygons. A call (polygon [(x1, y1); (x2, y2); ...] color) creates a polygon with the given color connecting the points specfied by the (x, y)'s. As with all images, the polygon is inscribed in a rectangle. The pinhole of that rectangle is given by the minimum x and minimum y values of the points defining the polygon. Write a function hexTiling : int -> Image.t such that given a call (hexTiling size), the hexTiling function returns an image with randomly colored regular hexagons where each side is of length size. In order to solve this problem, you'll probably want to create a helper function that uses the Image.polygon function to draw a regular hexagon as shown in Figure Hexagon above. Part C: (Up to 6 Points) Convex Pentagonal TilingConvex pentagons can be used to make especially beautiful tilings.
See this article for the details. Recently, a new pentagon shape was discovered that can be used in tiling.
See the above article for details. Part D: (Up to 6 Points) Roll Your OwnChoose your own tessellation for up to 6 points extra credit. Better yet, enter the CS1101 Tessellation Contest below! Some possible tiles include:
CS1101 Spring Tessellation ContestIf you find tessellation interesting and would like to try your hand at making a beautiful and interesting tiling, have at it! The most interesting tessellation submitted by Thursday March 31, midnight, will receive a prize and one bump of their final letter grade. This means that a C+ would move to a B-, a B would move to a B+ and so forth.
Tessellation submissions will be presented in class and voted on by members of the class. In the case of a tie, the course staff will break the tie. SubmissionsSpring 20160 12 3 Fall 20141 2 34 5 6 7 8 Fall 20131 2 34 5 6 7 8 9 |