Jump to content
  • Advertisement
Sign in to follow this  
Ksingh30

Uses of Math

This topic is 4077 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey. I just wanted to know the use of certain things in Computer graphics. -Determinants -Inverse of a Matrix -Basis

Share this post


Link to post
Share on other sites
Advertisement
I cannot think of a time when I have specifically used determinates or a nonstandard basis (i,j,k works fine for me), but linear algebra is definitely one of the most important math subjects for computer graphics. Linear algebra is used to transform vectors to different coordinate spaces and to perform rotations, translations, and scaling operations. Many of these operations are built-in so the programmer doesn't have to get too involved with tedious things like evaluating determinants.

Share this post


Link to post
Share on other sites
I know. I was just wondring. Its pretty obvious to me the use of matrices for transformations and such. but i took a linear algebra course, and a friend asked me the use of determinants in computer graphics and I really couldnt really tell him anything other then that they can be used to find the area of paralellograms.

Share this post


Link to post
Share on other sites
Determinants: You would use determinants primarily when finding the inverse of matrices using the cofactor method, up to a reasonable size (4x4 for instance). Otherwise you use the Gaussian method which doesn't directly involve the determinant, but for just computer graphics you're not usually going to be working with anything larger than a 4x4. I've personally used a variant of the cofactor method for determinants in order to build a generalized n-dimensional "cross product" operator, but that wasn't graphics related. I'm sure there are a few other applications I'm failing to remember at the moment.

Inverse of a Matrix: You use the inverse all the time :) Anytime you want to reverse a transformation, for instance, you need the inverse of the matrix. Granted, many matrices in computer graphics have special forms that allow you to take advantage of optimized inversion methods (i.e. A-1 = AT for a rotation matrix), but all the theory involves inverses. There are also hoards of times you would use matrix inverses outside of computer graphics, of course, but I won't go into those.

Basis: Surprisingly, I used custom basis a lot, primarily when designing algorithms that need to deal in subspaces of 3D. Many problems can be solved rather easily by choosing a clever basis and eliminating redundant dimensions. In computer graphics, you're likely only to use 3D orthogonal basis and move from one to another using the three primary transformations: translation, rotation, and scaling.

Share this post


Link to post
Share on other sites
A few more ideas, more or less (perhaps less) related to graphics:

Determinants are incredibly useful, and have many magical properties that people often overlook. Geometrically, the determinant is a measure of the 'size' of a matrix. If you're given an arbitrary linear transformation, you can get a good idea of how it will scale a uniform set of vertices just by looking at the magnitude of the determinant. In particular, rotations and translations all have determinant equal to one, because they preserve the size of objects. On a similar vein, if you are given a transformation that is composed of any number of rotations, reflections, translations and scalings, you can tell if objects will come out mirrored or not by checking the sign of the determinant. In numerical algebra, the rate of convergence of any iterative process will be strongly determined by the determinant of the iteration matrix.

The inverse of a matrix is necessarily calculated (often implicitly) when solving any linear system of equations. Indirectly, this is the same as matrix reduction. So whether you realise it or not, you are inverting a matrix whenever you solve a set of simultaneous equations, compute a least common multiple/greatest common divisor or even when you long-divide.

Bases are also quite subtle in their uses. I'm sure you've used coordinate systems other than the Cartesian one in the past. So next time you convert a vector to polar form, compute a yaw-pitch-roll rotation matrix, barycentric coordinates, spherical harmonics, Fourier/wavelet transform, you'll be converting from one basis to another. Knowing exactly which basis it is that you're using is often unimportant for practical purposes, so we tend not to think about it. But don't forget about those who once slaved away in the sewers of pure mathematics so you could get your work done [wink].

Admiral

Share this post


Link to post
Share on other sites
I just wanted to make a small comment on the use of bases. You have to switch back and forth between "ellipsoid" space when implementing swept sphere collision detection ;).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!