6 ms·
More Linear Algebra plus Trig... trig won't teach you eigenvetors, normals, etc.
by peapicker 6y ago
More Linear Algebra plus Trig... trig won't teach you eigenvetors, normals, etc.
- banachtarski 6y agoNormals are part of trigonometry. Eigenvectors won't show up in an elementary path/ray tracer. You need the most barebone understanding of LA for xform composition/application.
- dragontamer 6y agoThe way I see it: the linear algebra parts are just optimizations. You can probably??? write a raytracer using Trig alone: it just means that you'll be using sin/cos on angles instead of "short-cutting" with a dot-product to determine normal vectors. Hmmm... well... maybe the concept of dot-products and orthogonal vectors will help. So Linear Algebra probably will make things easier if you studied that too... but I still think its kinda optional.
- Arelius 6y agoCan you even get the angle between two three dimensional vectors without using some sort of vector product and venturing into linear algebra territory?
- dragontamer 6y agoYeah. Its just harder using Trig: SOH CAH TOA. tan(angle) = opposite-leg / adjacent-leg. arctan(opposite-leg / adjacent-leg) == angle. The more I do this, the more I realize that the linear-algebra approach might be easier... but the Trig approach can certainly do what you are asking for. I mean, I recognize that I'm just "reinventing cross-product" here to get the length of opposite-leg and the direction of adjacent-leg. But it does seem feasible to do all of these things in Trigonometry alone. A little bit of Linear algebra (cross product creates an orthogonal vector) would definitely make this problem easier.
- Arelius 6y agoOk, hmm I'm still a bit lost though, those identities work on a right triangle, but how do you construct a right triangle between two 3D vectors A, and B?
- Arelius 6y agoLike I could see how you could figure this out if you can project one line onto another maybe, but I also don't know how to do that with just trig.
- dragontamer 6y ago> Ok, hmm I'm still a bit lost though, those identities work on a right triangle, but how do you construct a right triangle between two 3D vectors A, and B? (0,0,0), A, and B are the three points of a right-triangle. Hmm... okay, yeah. I see what you mean. Every time I think about how to do things, its linear algebra time. The thing is: I've had this feeling before in other maths: the more you study one math subject, the "worse" you get in another. There's surprising things you can do with algebra alone without any calculus... but once you learn calculus, you kinda forget those old algebra tricks.
- Arelius 6y ago>(0,0,0), A, and B are the three points of a right-triangle. Your next line suggests you already know this, but just so it's clear it's not, they are three points in an arbitrary triangle. Each vector has a right triangle between the origin and (two of?) it's axis, but I'm not sure that's helpful. Yeah, I agree in that it feels like you should be able to do this, but I just know that I've been stumped in the past, and can't figure it out now either.
- dragontamer 6y agoAh right. Law of Sines sin(a) / A = sin(b) / B = sin(c) / C Apparently, MY trigonometry is awful and needs more practice! Law of sines is basic 'non-right triangles' stuff. There are three legs: A-0, B-0, and B-A. Hmmm... B-A seems like a vector operation (but its a really easy one, so... probably can be figured out without formally studying linear algebra).. That gives us the "A", "B" and "C" for lengths. Aaaannnnd I'm stuck again. I have the lengths but I don't have the angles. I only need to find one angle and the other two are solved with law of sines. Maybe a system of equations at this point (lol, another subject where linear algebra helps). The law of sines gives 3-unknowns, but only 2-equations. So I still need one more constraint before I can math-out a solution. ------ EDIT: Law of sines is fully: sin(a) / A = sin(b) / B = sin(c) / C = d Where "d" is the diameter of the circumcircle of the triangle. So the circumcircle's diameter gives us the 3rd equation needed to solve the above system of equations (using non-matrix math). So yeah, I think its possible. Its just waaayyyy harder to do. I also am handwaving a difficult part. I guess... take the average of 3 points, which would give the center of the circumcircle. Then sqrt(x, y, z) from the center to find the radius, then 2*radius = d. Wow, that's a lot of work compared to an easy projection matrix...
- dahart 6y agoI think of it not exactly, but sort-of, the other way around: using trig without any linear algebra is a shortcut to doing the linear algebra. Or maybe it’s just that the trig stays the same, but it’s possible to hard-code or short-cut your transforms to not include matrices or dot products explicitly... in simple cases. In reality trig and LA aren’t in competition, they’re both necessary in a serious renderer, and they represent different tools and different views on vectors. Sines and cosines fall out of rotations because of the implicit circle involved, but it’s more general to think of a transform between two basis frames. It just so happens that the lengths of basis vectors of one frame projected to the other are computed using sines and cosines, but the transform and dot products are there whether they’re made explicit or not. Using only sines and cosines falls apart very quickly, here are a couple of examples: Compute a surface normal under non-uniform scaling. You need the inverse transpose matrix. I don’t even know how to derive it using trig. Implement instancing or a character rig in your ray tracer. As soon as you need to compose transforms just to trace a ray, the trig route is off the table (impractical in the extreme), and matrix math is required. An alternative might be geometric algebra - is that in the same boat with linear algebra for you?
- nspattak 6y agothe word trigonometry comes from the greek word "trigono" (triangle) and "metro" (count) which quite clearly describe what trigonometry covers: counting triangles (ie sides and angles). Its history dates back to at least the ancient greeks (if not more/other civilizations, I do not know). Linear algebra is a different field of mathematics which focuses on solving systems of linear equations which has a LOT of applications (even in other non applied mathematics). I think it is better if you do not try to think one as part of the other. trigonometry provides the trigonometric functions, their relationship and a few basic equations. Linear algebra provides vectors/matrices. You need both of them to model 3D objects and vectors interscting with them (aka rays hitting objects)