Computational Geometry

Slides:



Advertisements
Similar presentations
Transforming from one coordinate system to another
Advertisements

Computational Geometry & Collision detection
Introduction It is not uncommon for people to think of geometric figures, such as triangles and quadrilaterals, to be separate from algebra; however, we.
VECTORS Computer Graphics. A REVIEW OF VECTORS:  Scalar Quantity  Vector Quantity  2D vectors  Graphical Representation of Vectors  Magnitude of.
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
For any two vectors A and B, which of the following equations is false. A) A – A = 0 B) A – B = A + B C) A + B = B + A D) A/a = 1/a (A), where ‘a’ is a.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Chapter 2: Vectors Ian Parberry University of North Texas Fletcher Dunn Valve Software 3D Math Primer for Graphics and Game Development.
IWBAT compare and order positive and negative numbers.
Ch. 3, Kinematics in 2 Dimensions; Vectors. Vectors General discussion. Vector  A quantity with magnitude & direction. Scalar  A quantity with magnitude.
Chapter 4.1 Mathematical Concepts
Vectors A vector is a quantity that is characterized by both magnitude and direction. Vectors are represented by arrows. The length of the arrow represents.
Vectors. Vectors and Direction Vectors are quantities that have a size and a direction. Vectors are quantities that have a size and a direction. A quantity.
1 Tuesday, Sept. 10: 17:20 – 19:10 Wednesday, Sept. 10: 17:20 – 19:10 Thursday, Sept. 10: 17:20 – 19:10 Building 6, Room 125 (For students of Dr. Al Ramadan)
CHAPTER 5 FORCES IN TWO DIMENSIONS
Vectors Day 2. Scalar Multiplication A vector can be multiplied by a real number Multiplying a vector by a positive number changes its size, but not its.
Matthew Christian. About Me Introduction to Linear Algebra Vectors Matrices Quaternions Links.
Adding Vectors on the Same Line When two vectors are in the same direction it is easy to add them. Place them head to tail and simply measure the total.
Chapter 1: Square Roots and the Pythagorean Theorem Unit Review.
Review from Friday The composition of two reflections over parallel lines can be described by a translation vector that is: Perpendicular to the two lines.
Finding the distance between two points. (-4,4) (4,-6)
Inner Product, Length and Orthogonality Prepared by Vince Zaccone For Campus Learning Assistance Services at UCSB.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Chapter 3: Real Numbers and the Coordinate Plane.
Unit 10 Transformations. Lesson 10.1 Dilations Lesson 10.1 Objectives Define transformation (G3.1.1) Differentiate between types of transformations (G3.1.2)
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Computer Graphics Lecture 11 2D Transformations I Taqdees A. Siddiqi
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry "Old Henry And His Old Aunt" Defined using right triangle  x y h.
YEAR 11 MATHS REVISION Transformations.
Intro to Math… Lesson 1. 4 Fundamental Operations Of Math Example: adding + subtracting - multiplying x dividing ÷
DSP-First, 2/e LECTURE #3 Complex Exponentials and Complex Numbers.
Midpoint and Distance in the Coordinate Plane
CO1301: Games ts 2015 Lecture 6 Vectors Dr Nick Mitchell (Room CM 224)
Introduction Treatment of a body as a single particle is not always possible. In general, the size of the body and the specific points of application.
Basic Math in 2D Game Development
Vectors, Roots of Unity & Regular Polygons
COMPLEX NUMBERS and PHASORS
Window reshaping, Keyboard interaction, Camera, Drawing objects
LECTURE #3 Complex Exponentials & Complex Numbers
Outline Addition and subtraction of vectors Vector decomposition
Vectors in the Plane.
Complex Numbers Imaginary Numbers Vectors Complex Numbers
How do we add and subtract vectors?
Vectors Vector: a quantity that has both magnitude (size) and direction Examples: displacement, velocity, acceleration Scalar: a quantity that has no.
Vectors Objective Students will be able to use basic vector operations to solve problems.
Binary, Decimal and Hexadecimal Numbers
4.1 Vectors in Physics Objective: Students will know how to resolve 2-Dimensional Vectors from the Magnitude and Direction of a Vector into their Components/Parts.
Vectors Jeff Chastine.
Scalars and Vectors.
To find the surface area of a cuboid
Linear Algebra Review.
Chapter 3: Vectors.
8-1 Geometric Vectors 8-2 Algebraic Vectors
Introduction It is not uncommon for people to think of geometric figures, such as triangles and quadrilaterals, to be separate from algebra; however, we.
Inner Product, Length and Orthogonality
Lecture 03: Linear Algebra
Adding Subtracting Multiplying Polynomials
SCI340_L05 _vectors.ppt More math concepts
Algebraic Addition of Vectors
Ch. 3: Kinematics in 2 or 3 Dimensions; Vectors
Kinematics & Dynamics in 2 & 3 Dimensions; Vectors
(c) University of Wisconsin, CS559
Proving simple Geometric Properties by using coordinates of shapes
Ch. 15- Vectors in 2-D.
12CDE 12C: Vectors in the Plane 12D: The Magnitude of a Vector
Addition Graphical & & Subtraction Analytical
Game Programming Algorithms and Techniques
Complex Number.
Math with Vectors I. Math Operations with Vectors.
Presentation transcript:

Computational Geometry Vectors, Translation, Rotation George Georgiev Telerik Corporation www.telerik.com

Table of Contents Analytic geometry Vector math Programming it Vectors and Points Vector math Addition / Translation Subtraction Multiplication / Scaling 2D Rotation Vector length Programming it

Analytic geometry The math

Analytic geometry Also called Cartesian geometry Coordinate system Applies algebraic principles to geometry Algebra Analysis

Analytic geometry Points (vertices) Represented by coordinates 2D – (X, Y); 3D – (X, Y, Z); Etc.. Points are locations in space

Analytic geometry Points Example – A (3, 2); H (-1.5, 3);

Analytic geometry Vectors Represented exactly the same way Different only by concept Have Direction Magnitude (length) Computers understand vectors Points – vectors added to the beginning of the coordinate system (0, 0)

Analytic geometry A Point A vector to the point

Vector math It's easy

Vector math Addition Subtraction Vectors can be added just like numbers Called translation when applied to a point Example A(5, 10) + B(-3, 7) = C(2, 17) Subtraction Subtracting two points gives the vector from the second to the first Example: A(5, 10) - B(-3, 7) = V(8, 3)

Vector math Multiplication By a number Called uniform scaling Multiple each coordinate by the number V(5, 7) * 3 = V’(15, 21) Called uniform scaling Division works the same way You can always multiply by 1/3 (that’s 0.33) V(15, 21) / 3 = V’(5, 7) V(15, 21) * 0.33 = V’(5, 7)

Vector math 2D Rotation A little more complicated Multiply two of the vector’s coordinates according to a formula The formula The vector V(x, y) rotated by the angle ALPHA x’ = x*cos(ALPHA) - y*sin(ALPHA) y’ = x*sin(ALPHA) + y*cos(ALPHA) The resulting vector is V’(x’, y’)

Vector math 2D Rotation Positive angle, counter-clockwise rotation Negative angle, clockwise rotation

Vector math Vector length Calculated with the Pythagorean theorem The vector’s x and y components are perpendicular The vector’s length is: length = sqrt (x*x + y*y) Where sqrt is the square root

Vector math Unit vector A unit vector is a vector with a length of 1 A unit vector multiplied by a number has length equal to the number ‘Converting’ a vector to a unit vector Called Normalization Get the length of the vector Divide the vector by it’s length

* Vector math Live Demo (c) 2008 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Point classes, functions, operators Programming geometry Point classes, functions, operators

Programming geometry We need A class describing a point/vector Operators for vector addition, multiplication A rotation method A normalization method A length calculation method

Programming geometry Live Demo * (c) 2008 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Computational geometry ? ? ? ? ? Questions? ? ? ? ? ? ?