5. Euclidean Geometry
Greek mathematician – Euclid (300 BC)
Elements – first systematic text on the studies of
geometry. Assuming a small set of axioms
(assumptions), it proves other propositions by logical
deduction.
We focus on the Plane Geometry (2D)
23. Golden section
The ratio of the golden section is roughly,
1:1.618 or 0.618:1
If we take a look at the Fibonacci sequence,
1, 1, 2, 3, 5, 8, 13, 21, 34, …
When we divide two consecutive numbers …
50. More path command
We start from a simple LINETO with the use of sine and
cosine functions we have learnt in secondary school.
LINETO (cos(?), sin(?))
60. Randomness
We may from time to time to create something not that
deterministic. That is, we want surprise.
In mathematics, it is randomness and probability we
have learnt in secondary school.
61. Randomness
Consider throwing a coin, we have Head or Tail. If we
design a coin with one side red and other side blue, we
can draw the coin. It can either be red or blue.
By using Context Free Art, we achieve by using multiple
rules of the same name.
62. Randomness
First, we define a red coin,
path CoinRed {
MOVETO (0, 0)
ARCTO (1, 0, 0.5)
ARCTO (0, 0, 0.5)
STROKE () []
FILL [h 0 sat 1 b 1]
}
63. Randomness
Then we define a blue coin,
path CoinBlue {
MOVETO (0, 0)
ARCTO (1, 0, 0.5)
ARCTO (0, 0, 0.5)
STROKE () []
FILL [h 240 sat 1 b 1]
}
64. Randomness
Then we have two definitions of a shape,
shape MyCoin {
CoinRed []
}
shape MyCoin {
CoinBlue []
}