GameMath

# GameMath

Notes from https://gamemath.com/book/.

## Initial Thoughts

I've quickly skimmed some of these chapters, and it seems like quite a good resource! The writing style is quite nice with a bit of humor. Also, it does a good job of referencing concepts from previous chapters. That makes it easier to read chapters out of order. If you don't know something, you can just backtrack.

## Chapter 1: Cartesion Coordinate Systems

Currently skipped this chapter.

## Chapter 2: Vectors

They have a great in-depth section on dot product which is great. It builds it up geometrically, and using the traditional formula as well. Kind of reminds me of how it was done in Julius Smith's MDFT book.

The cross product (or vector product) is also mentioned here, which I always forget how to do.

## Chapter 3: Multiple Coordinate Spaces

Briefly looked at the section on "upright space" because I was attempting to read the rotation in 3 dimensions chapter. But that's about it.

## Chapter 4: Introduction To Matrices

This has been the most helpful/practical chapter for me so far. It was a great refresher on matrix operations.

## Chapter 5: Matrices and Linear Transformations

A good "refernce" chapter for linear things like rotation, scaling, and shearing. They also provide mathematical derivations, which I could follow somewhat.

## Chapter 6: More on Matrices

This chapter goes more into mathematical properties of matrices. A good one to look back on.

## Chapter 7: Polar Coordinate Systems

I read some of this chapter because I figured they might be used in spatial audio (something I actually don't have a great deal of experience in). 3d polar spherical coordinates are something I need to better visualize.

## Chapter 8: Rotation in 3 Dimensions

A handful of rotation techniques, including an explanation of Quaternions. At this point, I was kind of overloaded on math, so I kind of gave up on this chapter. Lots of

## Chapter 9: Geometric Primitives

TBD. But the contents remind me of raytracing stuff.

## Messages

Anything tagged with the group (not page!) "@gamemath" [0f0e13a4] 2022-03-17-06-26: cross product is also know as the vectory product

[a1123135] 2022-03-17-06-25: still grokking what a null space is. wikipedia has a page for it, but they call it "kernel", or "the linear subspace of teh domain of the map which is mapped to the zero vector".

[538ae069] 2022-03-17-06-22: zero vector: special vector that has zeroes in every position.

[d26b2ab8] 2022-03-17-06-16: I don't think I really need to master any kind of linear transformations, but maybe some high level concepts.

[3cc4c377] 2022-03-17-06-14: spending more time today focusing on matrix multiplication fundamentals, cross product, dot product, and then 3d polar notation. then I think that's all I can do for now.

[7c68cc4a] 2022-03-17-06-11: the diagonal movement of determinants reminds me of the cross product.

[015cfa3d] 2022-03-16-19-59: 8.6 has a fantastic overview of rotation methods. almost gives me motivation to go back haha

[397ed12c] 2022-03-16-19-55: okay, I'm just reading the conclusion stuff for the rotation stuff. This just isn't going to stick in the next 48 hours.

[74415f94] 2022-03-16-13-23: TODO look at rotation matrix in section 8.7.3 (I skipped to quaternions lol)

[36aabc3f] 2022-03-16-13-22: I think there was something mentioned about quaternions not having gimble lock, but I could totally be making that up.

[be45abe3] 2022-03-16-13-22: from this text, it seems like a big thing quaternions have is certain elegance in mathematical notation. Figure 8.7 is indeed very elegant, but a bit dense too.

[87db56ca] 2022-03-16-12-20: upright space: a convention used to help describe coordinate space transitions. The axes of upright space are parallel with the axes of world space, but the original is coincident with the origin of object space.

[74f05da5] 2022-03-16-12-15: camera space: the object space associated with the viewpoint used for rendering.

[3b87ac65] 2022-03-16-12-14: object space: coordinate space associated with a particular object.

[3120808b] 2022-03-16-12-13: world coordinate system: a coordinate system that specifies the global reference frame for all other coordinate systems to be specified.

[b2abc4d2] 2022-03-16-12-12: world coordinate system: coordinate system that establishes the "biggest" coordinate system in games, which is the "entire world".

[85c5447c] 2022-03-16-12-10: quickly learning about object space and upright space. appreciate the hints in these chapters!

[61ef910e] 2022-03-16-12-08: helpfully, the author outlines some conventions in polar coordinates in the context of gaming. unfortunately, there are slightly different systems depending on what kind of person you talk to.

[985dc03a] 2022-03-16-12-06: I just want to get to the 3d rotation chapter. 3d polar coordinates will have to simmer.

[af8a62ba] 2022-03-16-11-57: DSP math uses a lot of polar coordinate systems, so I'm skipping a lot of this.

[03fdfa99] 2022-03-16-11-56: aliasing: in polar coordinate space, this happens when two numbers are different but point to the same place in space.

[664b2d88] 2022-03-16-11-54: briefly skipping out on the the rest of the more matrices chapter. going to briefly look at polar coordinate systems because it is relavant in 3d spatial audio. then, quaternions.

[8de985da] 2022-03-16-10-56: cofactor: same as the corresponding minor, but with alternating minors negated.

[d73d0c92] 2022-03-16-10-55: minor: the determinant of a submatrix.

[679691f4] 2022-03-16-10-52: the "triple product", described as (a x b) . c, is kind of melting my brain right now haha. It simultaenously makes sense and no sense.

[d8b559c9] 2022-03-16-10-50: right of the bat, they say that a general definition for a determinant is "fairly complicated", and they kind of throw 2x2 and 3x3 determinant equations at you. Diagrams are helpful. It feels a bit opaque. Kind of like learning the DFT for the first time.

[369f3846] 2022-03-16-10-48: determinant: a special scalar produced from square matrices that have useful properties in linear algebra, and also some interesting geometric interpretations.

[eaf985a2] 2022-03-16-10-44: onto chapter 6: More on Matrices. I've always been confused of matrices, so I'm excited to jump in!

[a74b7fbf] 2022-03-16-10-44: finished reading chapter 5. this felt more like a reference chapter, as there are a lot of plug-n-chug equations. but the derivations were appreciated.

[c61c4e5a] 2022-03-16-10-39: rigid body transformation is also known as proper transformations

[cbf469fc] 2022-03-16-10-38: rigid body transformation: a rigid-body transformation is one that changes location and orientation of an object, but not its shape.

[7fe389ea] 2022-03-16-10-37: translation, rotation, and reflection are the only orthogonal transformations.

[d98bae34] 2022-03-16-10-36: orthogonal: a term used to describe a matrix whose rows form an orthonormal basis.

[fb2db68f] 2022-03-16-10-35: angle-preserving: a transformation if the angle between two vectors is not altered in either magnitude or direction after transformation. Only translation, rotation, and uniform scale are angle-preserving transformations.

[b8e0c84a] 2022-03-16-10-33: need to grok what null spaces and zero vectors are.

[b0ddfca4] 2022-03-16-10-32: invertable: property of a transformation if there exists an opposite transformation.

[8b340b26] 2022-03-16-10-31: singular: a matrix that has no inverse. the determinant of an invertable matrix is nonzero.

[8268eb94] 2022-03-16-07-45: active transformation: the object is transformed while the coordinate space remains stationary.

[2c52d372] 2022-03-16-07-42: affine transformation: a transformation that contains translation.

[c497d93a] 2022-03-16-07-20: okay, chapter 4 initally read. most of it clicks. if I had more time, I'd do some of the practice problems. I have a few more chapters I need to cram in, so onto 5 now.

[6768398b] 2022-03-16-06-55: scratch that: vendors mix it up. DirectX uses row. OpenGL uses column.

[63d271d1] 2022-03-16-06-53: row vectors are preferred in video game programming over column vectors when doing matrix multiplication.

[83814c3a] 2022-03-16-06-51: vector-times multiplication is a lineaer combination of the rows or columns in a matrix.

[d3b0c9df] 2022-03-16-06-45: matrix chain problem: the problem of finding the parenthesization that minimizes the number of scalar multiplications.

[5ac6a9d2] 2022-03-16-06-33: an rxn matrix A multiplied by an nxc matrix B yields an rxc matrix AB.

[95554cde] 2022-03-16-06-31: matrix transposition makes an rxc matrix a cxr matrix

[f8fddb63] 2022-03-16-06-29: column vector: a Nx1 matrix.

[b537793e] 2022-03-16-06-29: row vector: a 1xN matrix.

[bc2d0d68] 2022-03-16-06-29: the identiy matrix multiplied with another matrix gets that matrix back. in some ways it's like what '1' is for scalars.

[96512637] 2022-03-16-06-27: identity matrix: diagonal matrix whose diagonal values are all 1.

[06f81e09] 2022-03-16-06-27: diagonal matrix: a matrix whose nondiagonal elements are zero.

[f7a4186b] 2022-03-16-06-26: diagonal elements: elements in a (square?) matrix for which the row and column indices are the same.

[103a4bf0] 2022-03-16-06-25: square matrices: matrices with the same number of rows and columns.

[cd62e1e5] 2022-03-16-06-24: matrices use 1-based indexing.

[b06eeea7] 2022-03-16-06-23: note to self: learn what a determinant of a matrix is (it apparently is discussed later). all I know is that there's vertical line notation involved.

[9ec13a6a] 2022-03-16-06-21: a vector is an array of scalars. a matrix is an array of vectors. (a programmer-y way of thinking about I suppose?)

[961d5579] 2022-03-16-06-20: starting chapter 4: introduction to matrices

[3a1064f7] 2022-03-16-06-18: chapters 4-8 seem to be the ones that feel most important to read right now. I don't feel comfortable with matrix math, and quaternions are a mystery. Polar coordinates are used in 3d audio, so it'll be good to figure that out.