Ar1 twf030 lecture1.2

30
1 1 Preliminaries of Basics of Linear Algebra & Computer Geometry Dr.ir. Pirouz Nourian Assistant Professor of Design Informatics Department of Architectural Engineering & Technology Faculty of Architecture and Built Environment

Transcript of Ar1 twf030 lecture1.2

Page 1: Ar1 twf030 lecture1.2

11

Preliminaries of

Basics of Linear Algebra & Computer Geometry

Dr.ir. Pirouz Nourian

Assistant Professor of Design InformaticsDepartment of Architectural Engineering & TechnologyFaculty of Architecture and Built Environment

Page 2: Ar1 twf030 lecture1.2

22

Try to guess how a line or a circle is represented in a computer

“If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck.”

Image: DUCK: GETTY Images; ILLUSTRATION: MARTIN O'NEILL, from http://www.nature.com/nature/journal/v484/n7395/full/484451a.html?message-global=remove

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Page 3: Ar1 twf030 lecture1.2

33

The image of a geometry is not the same as its representation

What you see is not what you get

Image: René Magritte, ceci n'est pas une pipe (this is not a pipe)

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Page 4: Ar1 twf030 lecture1.2

44

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Page 5: Ar1 twf030 lecture1.2

55

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

On terminology

• Geometry: Point (0D), Curve(1D), Surface(2D), Solid (3D) [free-form]

• Geometry: Point (0D), Line(1D), Polygon(2D), Polyhedron (3D) [piecewise linear]

• Topology: Vertex(0D), Edge(1D), Face(2D), Body(3D)

• Graph Theory: Object, Link, (and n-Cliques)

Page 6: Ar1 twf030 lecture1.2

66

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

WYSIWYG versus WYSIWYM

𝑥2 + 𝑦2 = 𝑅2

The Product vs The Process

Page 7: Ar1 twf030 lecture1.2

77

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Parametric Modeling & Design• Thinking of parameters instead of numbers!• Same rationales, many alternatives!

▪ We could model an actual circle as a particular instance of a generic circle, which is the locus of points equidistant from a given point as C (center), at a given distance R (Radius), on a plane p.

▪ Parametric modeling is essential for formulating design problems▪ The same role algebra has had in the progress of mathematics, parametric modeling will have in systematic (research-oriented) design.

𝑥 = 𝑟𝑐𝑜𝑠(𝑡)𝑦 = 𝑟𝑠𝑖𝑛 𝑡𝑡 ∈ [0,2𝜋]

𝑡 =2𝜋𝑖

𝑛|𝑖 ∈[1,n]⊂ ℕ

Plane

RadiusCircle

Page 8: Ar1 twf030 lecture1.2

88

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Parametric Modeling & Design• Thinking of parameters instead of numbers!• Same rationales, many alternatives!

▪ We could model an actual circle as a particular instance of a generic circle, which is the locus of points equidistant from a given point as C (center), at a given distance R (Radius), on a plane p.

▪ Parametric modeling is essential for formulating design problems▪ The same role algebra has had in the progress of mathematics, parametric modeling will have in systematic (research-oriented) design.

𝑥 = 𝑟𝑐𝑜𝑠(𝑡)𝑦 = 𝑟𝑠𝑖𝑛 𝑡𝑡 ∈ [0,2𝜋]

𝑡 =2𝜋𝑖

𝑛|𝑖 ∈[1,n]⊂ ℕ

Plane

RadiusCircle

Page 9: Ar1 twf030 lecture1.2

99

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Page 10: Ar1 twf030 lecture1.2

1010

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Page 11: Ar1 twf030 lecture1.2

1111

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Page 12: Ar1 twf030 lecture1.2

1212

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Vectors in a Nutshell

Applications

• Any representation in Computer Graphics depends on vectors (points, lines, etc. are all eventually based on vectors)

• Any transformation (e.g. moving objects, rotating them, etc.)• It suffices to say there is no 3D geometry without vectors!

Page 13: Ar1 twf030 lecture1.2

1313

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Vectors in a Nutshell

René Descartes

Image courtesy of David Rutten,

from Rhinoscript 101

Page 14: Ar1 twf030 lecture1.2

1414

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Ԧ𝐴 = 𝑎𝑥Ԧ𝒊 + 𝑎𝑦 Ԧ𝒋 + 𝑎𝑧𝒌

𝐵 = 𝑏𝑥Ԧ𝒊 + 𝑏𝑦 Ԧ𝒋 + 𝑏𝑧𝒌

Ԧ𝐴 + 𝐵 = (𝑎𝑥 + 𝑏𝑥)Ԧ𝒊 + (𝑎𝑦+𝑏𝑦)Ԧ𝒋 + (𝑎𝑧+𝑏𝑧)𝒌

Euclidean Vector Length

Ԧ𝐴 = 𝑎𝑥2 + 𝑎𝑦

2+ 𝑎𝑧

2

Page 15: Ar1 twf030 lecture1.2

1515

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Exemplary application: detecting perpendicularity or similarity

𝑊 = 𝑭.𝑫 = 𝑭 . 𝑫 cos 𝜃

Page 16: Ar1 twf030 lecture1.2

1616

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Exemplary application: detecting perpendicularity or similarity

𝑊 = 𝑭.𝑫 = 𝑭 . 𝑫 cos 𝜃

Other applications:

• Computing ‘flux’ in a vector field (e.g. solar irradiation)

• Detecting perpendicularly

• Computing angles (with the help of an Arc Cosine function)

• A very long list of techniques and tricks in computational

geometry & computer graphics

• You cannot get by without knowing about dot products! ☺

Page 17: Ar1 twf030 lecture1.2

1717

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Dot Product: How is it calculated in analytic geometry?

𝜃

B

A

Ԧ𝒊. Ԧ𝒊 = Ԧ𝒋. Ԧ𝒋 = 𝒌. 𝒌 = 1

Ԧ𝒊. Ԧ𝒋 = Ԧ𝒋. Ԧ𝒊 = 0

Ԧ𝒋. 𝒌 = 𝒌. Ԧ𝒋 = 0

𝒌. Ԧ𝒊 = Ԧ𝒊. 𝒌 = 0

So we do not have to do it by ‘drawing’ vectors and finding the angle between them with an angle ruler and a calculator! We do it algebraically instead.

Page 18: Ar1 twf030 lecture1.2

1818

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Dot Product: How is it calculated in analytic geometry?

Ԧ𝐴 = 𝑎𝑥 Ԧ𝒊 + 𝑎𝑦 Ԧ𝒋 + 𝑎𝑧𝒌 = 𝑎𝑥 𝑎𝑦 𝑎𝑧𝒊𝒋𝒌

𝐵 = 𝑏𝑥Ԧ𝒊 + 𝑏𝑦 Ԧ𝒋 + 𝑏𝑧𝒌 = 𝑏𝑥 𝑏𝑦 𝑏𝑧

𝒊𝒋𝒌

Ԧ𝐴. 𝐵 == Ԧ𝐴 . 𝐵 . 𝐶𝑜𝑠(𝜃)

𝜃

B

A

Ԧ𝐴. 𝐵 = 𝑎𝑥 𝑎𝑦 𝑎𝑧

𝑏𝑥𝑏𝑦𝑏𝑧

= 𝑎𝑥𝑏𝑥 + 𝑎𝑦𝑏𝑦 + 𝑎𝑧𝑏𝑧

Page 19: Ar1 twf030 lecture1.2

1919

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• TransformationImages courtesy of Wiki Commons and

Raja Issa, Essential Mathematics for Computational Design

http://chortle.ccsu.edu/vectorlessons/vch12/vch12_4.html

Page 20: Ar1 twf030 lecture1.2

2020

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Exemplary application: setting up a local coordinate system

• computing torque, electromotive force, etc in physics

• detecting parallelism

• a long list of techniques and tricks in computer graphics and computational

geometry

• computing volumes of polyhedrons

• Conclusion: you cannot get by without knowing about cross products either! ☺

Page 21: Ar1 twf030 lecture1.2

2121

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Cross Product: How is it calculated in analytic geometry?

Images courtesy of

Raja Issa, Essential Mathematics for Computational Design

Ԧ𝒊 × Ԧ𝒊 = Ԧ𝒋 × Ԧ𝒋 = 𝒌 × 𝒌 = 𝟎

Ԧ𝒊 × Ԧ𝒋 = 𝒌

Ԧ𝒋 × 𝒌 = Ԧ𝒊

𝒌 × Ԧ𝒊 = Ԧ𝒋

Ԧ𝒋 × Ԧ𝒊 = −𝒌

𝒌 × Ԧ𝒋 = −Ԧ𝒊

Ԧ𝒊 × 𝒌 = −Ԧ𝒋

Page 22: Ar1 twf030 lecture1.2

2222

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Cross Product: How is it calculated in analytic geometry?

Images courtesy of Raja Issa, Essential Mathematics for Computational Design

Ԧ𝐴 = 𝑎𝑥 Ԧ𝒊 + 𝑎𝑦 Ԧ𝒋 + 𝑎𝑧𝒌 = 𝑎𝑥 𝑎𝑦 𝑎𝑧𝒊𝒋𝒌

𝐵 = 𝑏𝑥 Ԧ𝒊 + 𝑏𝑦 Ԧ𝒋 + 𝑏𝑧𝒌 = 𝑏𝑥 𝑏𝑦 𝑏𝑧

𝒊𝒋𝒌

Ԧ𝐴 × 𝐵 = (𝑎𝑥 Ԧ𝒊 + 𝑎𝑦 Ԧ𝒋 + 𝑎𝑧𝒌) × (𝑏𝑥Ԧ𝒊 + 𝑏𝑦 Ԧ𝒋 + 𝑏𝑧𝒌) =

𝒊 𝒋 𝒌𝑎𝑥 𝑎𝑦 𝑎𝑧𝑏𝑥 𝑏𝑦 𝑏𝑧

Ԧ𝐴 × 𝐵 = Ԧ𝐴 . 𝐵 . 𝑆𝑖𝑛(𝜃)

Ԧ𝐴 × 𝐵 = 𝑎𝑦𝑏𝑧 − 𝑎𝑧𝑏𝑦 Ԧ𝒊 − 𝑎𝑥𝑏𝑧 − 𝑎𝑧𝑏𝑥 Ԧ𝒋 + 𝑎𝑥𝑏𝑦 − 𝑎𝑦𝑏𝑥 𝒌

Page 23: Ar1 twf030 lecture1.2

2323

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Page 24: Ar1 twf030 lecture1.2

2424

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Images courtesy of David Rutten, Rhino Script 101

Page 25: Ar1 twf030 lecture1.2

2525

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

Page 26: Ar1 twf030 lecture1.2

2626

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

http://geomalgorithms.com/a05-_intersect-1.html

Page 27: Ar1 twf030 lecture1.2

2727

• Digital Geometry

• Data Models

• Euclidean World

• Cartesian World

• Vectors

o Sum

o Dot Product

o Cross Product

• Planes

o Locus

o Orientation

• Intersection

• Transformation

• Linear Transformations: Euclidean and Affine (Translation [movement], Rotation, Scaling,etc.)

• Homogenous Coordinate System

• Inverse Transforms?

• Non-Linear Transformations?

Images courtesy of Raja Issa, Essential Mathematics for Computational Design

Page 28: Ar1 twf030 lecture1.2

2828

make a parametric staircase

Page 29: Ar1 twf030 lecture1.2

2929

make a parametric staircase

https://collections.museumvictoria.com.au/articles/4624

Page 30: Ar1 twf030 lecture1.2

3030

Good LuckQuestions:

[email protected]