DOC PREVIEW
Brown CSCI 1480 - Essential Mathematics for Computer Graphics

This preview shows page 1-2-3-4 out of 13 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Page 1 of 13 Dan Morris Handout #3 CS148 Summer 2005 Essential Mathematics for Computer Graphics • Trigonometry • Polar Coordinates • 3-D Coordinate Systems • Parametric Representations • Points and Vectors • Matrices This handout provides a compendium of the math that we will be using this quarter. It does not provide a complete presentation of the topics, but instead just gives the “facts” that we will need. We will not cover most of this in class, so you may want to keep this nearby as a handy reference. Trigonometry Let θ be an angle with its vertex at the origin and one side lying along the x-axis, and let (x,y) be any point in the Cartesian plane other than the origin, and on the other side of the angle. The six trigonometric functions are as follows: y (x,y) r θ x sin θ = y / r cos θ = x / r tan θ = y / x csc θ = r / y sec θ = r / x cot θ = x / y Angles can be specified in degrees or radians. One radian is defined as the measure of the angle subtended by an arc of a circle whose length is equal to the radius of the circle. Since the full circumference of a circle is 2πr, it takes 2π radians to get all the way around the circle, so 2π radians is equal to 360°. 1 radian = 180/π = 57.296° 1° = π/180 radian = 0.017453 radian FYI, OpenGL expects angles to be in degrees.Page 2 of 13 Polar Coordinates We are used to the standard Cartesian coordinate system of graphing, but there are many other methods. One common method is the polar coordinate method. In this system, the origin is at the center of the plane and one specifies coordinates by giving an angle θ and a radius r: r θ If you need to translate polar coordinates to Cartesian coordinates, use these formulas: x = r cos θ y = r sin θ Going from Cartesian to polar: r = sqrt(x2 + y2) θ = tan-1(y/x) 3-D Coordinate Systems In a 3-d Cartesian system, we specify 3 values to identify a point (x,y,z): y z x This is a right-handed system, which is most often used in graphics, i.e., the thumb of the right hand points down the z-axis if we imagine grabbing the z-axis with the fingers of the right hand curling from the positive x-axis toward the positive y-axis. In OpenGL’s coordinate system, the positive z axis points out of the screen. In OpenGL’s coordinate system, the positive z axis points out of the screen. I wrote that sentence twice on purpose because it’s just that important to remember this.Page 3 of 13 Parametric Representations There are two ways to visualize a curve: as a line “frozen” in space, or as the path of a particle as it moves in space. The first view leads us to describe the curve according to a function that defines the x- and y-coordinates of the curve; we’ll call this the functional form. Functional-form equations come in two flavors: explicit and implicit. An explicit equation specifies the y-coordinate for each value of x as y = f(x) or vice versa. For example, the equation for a line is y = mx + b. An implicit equation usually sets some function of all variables equal to a constant. For example, the equation for a circle is x2 + y2 - r2 = 0. A parametric form is the other way to view a curve. It suggests the movement of a point through time. The parameter is the value t (time) and is used to distinguish one point on the curve from another. The path of the particle traveling along the curve is fixed by two functions: x() and y() and we speak of (x(t), y(t)) as the position of the particle at time t. The curve is all the points visited by the particle over some interval, e.g., from 0 to 1. Now some terminology: A line segment is a straight path between two points, and it can be defined by its two endpoints. A ray is just like a line segment, only it extends infinitely in one direction. It can be defined by its endpoint and one other point on the ray, or by its endpoint and its direction (a vector). A line is just like a ray, only it extends infinitely in both directions. It can be defined by two points or by any point on the line and its direction (a vector). Back to parametric representations… Lines, line segments and rays all share the same parametric representation. All points on a line segment from a = (ax, ay) to b = (bx, by) are represented by the parametric form: x(t) = ax + (bx - ax)t y(t) = ay + (by - ay)t Usually we let t vary from 0 to 1. When t = 0, the point (x(t), y(t)) is at point a. As t increases toward 1, the point moves in a straight line toward b. It is midway between the two points when t = 1/2, and in general, it is a fraction f of the way from a to b at t = f. The ray that starts at a and passes through b is also defined by these equations but t is allowed to take on any nonnegative value. The ray passes through b at t = 1 but then continues forever along the same path. The line defined by points a and b is also defined by these equations but now all real values of t are permitted. Thus, line segments, rays and lines differ parametrically only in the values of t that are relevant: line segment: 0 ≤ t ≤ k (where k is often 1) ray: 0 ≤ t < ∞Page 4 of 13 line: -∞ < t < ∞ A circle with radius R centered at the origin of the Cartesian plane has the following parametric representation: x(t) = R * cos(2πt) y(t) = R * sin(2πt) for t between 0 and 1. If you try graphing this with equidistant values of t, you’ll end up with a circle. Points and Vectors Basics A point is a position specified with coordinate values in some reference frame. Points are only meaningful if I give you a reference frame, aka an origin and a set of coordinate axes. This is really important for CS148. Remember in Indiana Jones and the Last Crusade when the Joneses had detailed instructions on how to find the Holy Grail, but they didn’t know where the instructions started? When they found out that the instructions started at Alexandretta, that was like defining a reference frame. That was a loosely-related tangent. That movie was totally sweet. A vector is the difference between two points: P2 V P1 V = P2 - P1 = (x2 - x1, y2 - y1) = (Vx, Vy) (Vx, Vy) are called the Cartesian components or elements, and are


View Full Document

Brown CSCI 1480 - Essential Mathematics for Computer Graphics

Download Essential Mathematics for Computer Graphics
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Essential Mathematics for Computer Graphics and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Essential Mathematics for Computer Graphics 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?