On this page:
Programming for Architecture

Programming for Architecture

António Menezes Leitão

    1 Preface

    2 Programming

      2.1 Programming Languages

        2.1.1 Exercises 1

          2.1.1.1 Question 1

          2.1.1.2 Question 2

          2.1.1.3 Question 3

      2.2 The Julia Language

        2.2.1 Syntax, Semantics and Pragmatics

        2.2.2 Syntax and Semantics of Julia

        2.2.3 The Evaluator

      2.3 Language Elements

        2.3.1 Numbers

      2.4 Combinations

        2.4.1 Exercises 2

          2.4.1.1 Question 4

        2.4.2 Evaluating Combinations

        2.4.3 Strings

      2.5 Defining Functions

        2.5.1 Exercises 3

          2.5.1.1 Question 5

      2.6 Names

        2.6.1 Exercises 4

          2.6.1.1 Question 6

          2.6.1.2 Question 7

          2.6.1.3 Question 8

          2.6.1.4 Question 9

          2.6.1.5 Question 10

          2.6.1.6 Question 11

          2.6.1.7 Question 12

      2.7 Debugging

        2.7.1 Syntactic Errors

        2.7.2 Semantic Errors

      2.8 Predefined Functions

        2.8.1 Exercises 5

          2.8.1.1 Question 13

          2.8.1.2 Question 14

          2.8.1.3 Question 15

          2.8.1.4 Question 16

          2.8.1.5 Question 17

      2.9 Arithmetic in Julia

        2.9.1 Exercises 6

          2.9.1.1 Question 18

          2.9.1.2 Question 19

          2.9.1.3 Question 20

      2.10 Name Evaluation

      2.11 Conditional Expressions

        2.11.1 Logical Expressions

        2.11.2 Logical Values

      2.12 Predicates

        2.12.1 Arithmetic Predicates

      2.13 Predicates with a Variable Number of Arguments

      2.14 Recognizers

      2.15 Logical Operators

        2.15.1 Exercises 7

          2.15.1.1 Question 21

        2.15.2 Exercises 8

          2.15.2.1 Question 22

          2.15.2.2 Question 23

          2.15.2.3 Question 24

          2.15.2.4 Question 25

          2.15.2.5 Question 26

          2.15.2.6 Question 27

          2.15.2.7 Question 28

      2.16 Selection

        2.16.1 Multiple Selection

        2.16.2 Exercises 9

          2.16.2.1 Question 29

          2.16.2.2 Question 30

          2.16.2.3 Question 31

      2.17 Local Variables

      2.18 Global Variables

      2.19 Modules

        2.19.1 Exercises 10

          2.19.1.1 Question 32

          2.19.1.2 Question 33

          2.19.1.3 Question 34

    3 Modeling

      3.1 Coordinates

      3.2 Operations with Coordinates

        3.2.1 Exercises 11

          3.2.1.1 Question 35

          3.2.1.2 Question 36

        3.2.2 Bi-dimensional Coordinates

        3.2.3 Exercises 12

          3.2.3.1 Question 37

          3.2.3.2 Question 38

        3.2.4 Polar Coordinates

        3.2.5 Exercises 13

          3.2.5.1 Question 39

      3.3 Bi-dimensional Drawing

        3.3.1 Exercises 14

          3.3.1.1 Question 40

          3.3.1.2 Question 41

          3.3.1.3 Question 42

          3.3.1.4 Question 43

      3.4 Side Effects

      3.5 Sequencing

      3.6 Doric Order

      3.7 Parametrization of Geometric Figures

      3.8 Documentation

        3.8.1 Exercises 15

          3.8.1.1 Question 44

          3.8.1.2 Question 45

      3.9 Three-dimensional Modeling

        3.9.1 Predefined Solids

        3.9.2 Exercises 16

          3.9.2.1 Question 46

          3.9.2.2 Question 47

        3.9.3 Exercises 17

          3.9.3.1 Question 48

          3.9.3.2 Question 49

          3.9.3.3 Question 50

          3.9.3.4 Question 51

          3.9.3.5 Question 52

      3.10 Cylindrical Coordinates

        3.10.1 Exercises 18

          3.10.1.1 Question 53

          3.10.1.2 Question 54

      3.11 Spherical Coordinates

        3.11.1 Exercises 19

          3.11.1.1 Question 55

          3.11.1.2 Question 56

      3.12 Modeling Doric Columns

        3.12.1 Exercises 20

          3.12.1.1 Question 57

      3.13 Vitruvian Proportions

        3.13.1 Exercises 21

          3.13.1.1 Question 58

    4 Recursion

      4.1 Recursion in Mathematics

        4.1.1 Exercises 22

          4.1.1.1 Question 59

          4.1.1.2 Question 60

      4.2 Recursion in Architecture

        4.2.1 Exercises 23

          4.2.1.1 Question 61

          4.2.1.2 Question 62

          4.2.1.3 Question 63

          4.2.1.4 Question 64

          4.2.1.5 Question 65

          4.2.1.6 Question 66

          4.2.1.7 Question 67

          4.2.1.8 Question 68

          4.2.1.9 Question 69

          4.2.1.10 Question 70

      4.3 Doric Temples

        4.3.1 Exercises 24

          4.3.1.1 Question 71

        4.3.2 Exercises 25

          4.3.2.1 Question 72

          4.3.2.2 Question 73

      4.4 Ionic Order

        4.4.1 Exercises 26

          4.4.1.1 Question 74

          4.4.1.2 Question 75

          4.4.1.3 Question 76

      4.5 Recursion in Nature

    5 Randomness

      5.1 Random Numbers

      5.2 State

      5.3 Random Choices

        5.3.1 Random Fractional Numbers

        5.3.2 Random Numbers within a Range

        5.3.3 Exercises 27

          5.3.3.1 Question 77

          5.3.3.2 Question 78

          5.3.3.3 Question 79

          5.3.3.4 Question 80

          5.3.3.5 Question 81

          5.3.3.6 Question 82

      5.4 Urban Design

        5.4.1 Exercises 28

          5.4.1.1 Question 83

          5.4.1.2 Question 84

          5.4.1.3 Question 85

          5.4.1.4 Question 86

          5.4.1.5 Question 87

    6 Data Structures

      6.1 Arrays

        6.1.1 One-dimensional Arrays

      6.2 Recursion over Arrays

        6.2.1 Exercises 29

          6.2.1.1 Question 88

          6.2.1.2 Question 89

          6.2.1.3 Question 90

          6.2.1.4 Question 91

          6.2.1.5 Question 92

          6.2.1.6 Question 93

      6.3 Enumerations

        6.3.1 Exercises 30

          6.3.1.1 Question 94

          6.3.1.2 Question 95

          6.3.1.3 Question 96

          6.3.1.4 Question 97

          6.3.1.5 Question 98

          6.3.1.6 Question 99

          6.3.1.7 Question 100

          6.3.1.8 Question 101

          6.3.1.9 Question 102

      6.4 Polygons

        6.4.1 Regular Stars

        6.4.2 Regular Polygons

      6.5 Polygonal Lines and Splines

        6.5.1 Exercises 31

          6.5.1.1 Question 103

          6.5.1.2 Question 104

      6.6 Trusses

        6.6.1 Modeling Trusses

          6.6.1.1 Question 105

          6.6.1.2 Question 106

          6.6.1.3 Question 107

          6.6.1.4 Question 108

        6.6.2 Creating Positions

          6.6.2.1 Question 111

          6.6.2.2 Question 109

          6.6.2.3 Question 110

        6.6.3 Space Trusses

          6.6.3.1 Question 112

        6.6.4 Exercises 32

          6.6.4.1 Question 113

          6.6.4.2 Question 114

          6.6.4.3 Question 115

    7 Complex Shapes

      7.1 Constructive Solid Geometry

        7.1.1 Exercises 33

          7.1.1.1 Question 116

          7.1.1.2 Question 117

          7.1.1.3 Question 118

          7.1.1.4 Question 119

          7.1.1.5 Question 120

      7.2 Surfaces

        7.2.1 Trefoils, Quatrefoils and Other Foils

      7.3 Algebra of Shapes

        7.3.1 Exercises 34

          7.3.1.1 Question 121

          7.3.1.2 Question 122

          7.3.1.3 Question 123

          7.3.1.4 Question 124

          7.3.1.5 Question 125

          7.3.1.6 Question 126

          7.3.1.7 Question 127

          7.3.1.8 Question 128

          7.3.1.9 Question 129

          7.3.1.10 Question 130

          7.3.1.11 Question 131

          7.3.1.12 Question 132

          7.3.1.13 Question 133

          7.3.1.14 Question 134

      7.4 Slice of Regions

        7.4.1 Exercises 35

          7.4.1.1 Question 135

          7.4.1.2 Question 136

          7.4.1.3 Question 137

      7.5 Extrusions

        7.5.1 Simple Extrusion

        7.5.2 Exercises 36

          7.5.2.1 Question 138

          7.5.2.2 Question 139

          7.5.2.3 Question 140

          7.5.2.4 Question 141

          7.5.2.5 Question 142

          7.5.2.6 Question 143

          7.5.2.7 Question 144

          7.5.2.8 Question 145

          7.5.2.9 Question 146

          7.5.2.10 Question 147

          7.5.2.11 Question 148

        7.5.3 Extrusion Along a Path

        7.5.4 Exercises 37

          7.5.4.1 Question 149

          7.5.4.2 Question 150

        7.5.5 Extrusion with Transformation

      7.6 Gaudí’s Columns

      7.7 Revolutions

        7.7.1 Surfaces of Revolution

        7.7.2 Exercises 38

          7.7.2.1 Question 151

          7.7.2.2 Question 152

        7.7.3 Solids of Revolution

        7.7.4 Exercises 39

          7.7.4.1 Question 153

          7.7.4.2 Question 154

          7.7.4.3 Question 155

          7.7.4.4 Question 156

      7.8 Interpolations

        7.8.1 Interpolation without Guidelines

        7.8.2 Interpolation with Guidelines

        7.8.3 Exercises 40

          7.8.3.1 Question 157

    8 Transformations

      8.1 Introduction

      8.2 Translation

      8.3 Scale

      8.4 Rotation

      8.5 Reflection

      8.6 The Sydney Opera House

        8.6.1 Exercises 41

          8.6.1.1 Question 158

          8.6.1.2 Question 159

          8.6.1.3 Question 160

    9 Higher-Order Functions

      9.1 Curvilinear Facades

      9.2 Higher-Order Functions

      9.3 Anonymous Functions

        9.3.1 Exercises 42

          9.3.1.1 Question 161

          9.3.1.2 Question 162

          9.3.1.3 Question 163

      9.4 Identity Function

        9.4.1 Exercises 43

          9.4.1.1 Question 164

          9.4.1.2 Question 165

          9.4.1.3 Question 166

          9.4.1.4 Question 167

      9.5 The Restriction Function

        9.5.1 Exercises 44

          9.5.1.1 Question 168

          9.5.1.2 Question 169

          9.5.1.3 Question 170

      9.6 The Composition Function

        9.6.1 Exercises 45

          9.6.1.1 Question 171

          9.6.1.2 Question 172

          9.6.1.3 Question 173

      9.7 Higher-Order Functions on Arrays

        9.7.1 Mapping

        9.7.2 Filtering

        9.7.3 Reduction

        9.7.4 Exercises 46

          9.7.4.1 Question 174

      9.8 A Database of Shapes

        9.8.1 City Models from City Plans

        9.8.2 Exercises 47

          9.8.2.1 Question 175

          9.8.2.2 Question 176

          9.8.2.3 Question 177

    10 Parametric Representation

      10.1 Computation of Parametric Functions

      10.2 Rounding errors

      10.3 Mapping and Enumerations

        10.3.1 Exercises 48

          10.3.1.1 Question 178

          10.3.1.2 Question 179

          10.3.1.3 Question 180

        10.3.2 Fermat’s Spiral

        10.3.3 Cissoid of Diocles

        10.3.4 Lemniscate of Bernoulli

        10.3.5 Exercises 49

          10.3.5.1 Question 181

        10.3.6 Lamé Curve

        10.3.7 Exercises 50

          10.3.7.1 Question 182

          10.3.7.2 Question 183

          10.3.7.3 Question 184

          10.3.7.4 Question 185

          10.3.7.5 Question 186

          10.3.7.6 Question 187

      10.4 Precision

        10.4.1 Adaptive Sampling

        10.4.2 Exercises 51

          10.4.2.1 Question 188

          10.4.2.2 Question 189

      10.5 Space Curves

      10.6 Parametric Surfaces

        10.6.1 The Möbius Strip

      10.7 Surfaces

        10.7.1 Hyperbolic Paraboloid

        10.7.2 Exercises 52

          10.7.2.1 Question 190

          10.7.2.2 Question 191

        10.7.3 Helicoid

        10.7.4 Spring

        10.7.5 Exercises 53

          10.7.5.1 Question 192

          10.7.5.2 Question 193

        10.7.6 Seashells

        10.7.7 Cylinders, Cones, and Spheres

        10.7.8 Exercises 54

          10.7.8.1 Question 194

      10.8 Bodegas Ysios

        10.8.1 Exercises 55

          10.8.1.1 Question 195

          10.8.1.2 Question 196

          10.8.1.3 Question 197

          10.8.1.4 Question 198

          10.8.1.5 Question 199

          10.8.1.6 Question 200

          10.8.1.7 Question 201

          10.8.1.8 Question 202

      10.9 Surface Normals

      10.10 Surface Processing

        10.10.1 Exercises 56

          10.10.1.1 Question 203

          10.10.1.2 Question 204

          10.10.1.3 Question 205

        10.10.2 Exercises 57

          10.10.2.1 Question 206

          10.10.2.2 Question 207

    11 Epilogue