Page 32 of 34 FirstFirst ... 223031323334 LastLast
Results 1,241 to 1,280 of 1333

Thread: Computer Science and Math and Stuff

  1. #1241
    ^^vv<><>BASTART
    Posts
    8,313
    Quote Originally Posted by Jon`C View Post
    Not at all, this is a practical discussion. The perspective projection used for 3D games is based on a flat eye (~= your monitor). This causes severe distortions, which are especially bad with high FOV/ultra wide/VR.

    After reading it again, I believe he is talking about orthographic projections, not perspective projections.
    Well, okay, yeah a game which used orthographic projection would be very odd indeed. I suppose my post is exactly about the differences between orthographic and perspective projection when considering points at infinity. Perspective permits points at infinity being presented, which could be vanishing points (such processes seem to neglect a nice curvature in the lens for ease of drawing).

    The way your flat monitor distorts your round game camera lens, your round eyes distort straight lines. That's why road lines converge in the horizon.

    The thing that's weird about orthographic projection is in how it deals with points at infinity, mathematically speaking. If you're standing inside of a finite sphere, then everything makes sense: your Tait Bryan coordinates for your flat lens are in 1-1 correspondance with points on the sphere.

    If you try to take the limit of this sphere as the radius goes to infinity, **** gets weird really ****ing fast. The property above I mentioned is one. You'd think your vision could converge toward any point at infinity on the infinity sphere by tracing a radius out. But unless your eye is at the exact center, the angle you need to look directly at that point literally doesn't exist. So while every Tait Bryan angle you can look at has stuff in it, there is a huge amount of that infinity sphere you just plain cannot see using real-valued angles.

    What's weirder? Move a step in any direction, apply the same argument above. You can't see any point you could in the previous spot. If you tried to trace that line with your eyes, you'd converge back to the line you're at parallel to the previous line, which looks in a different spot. Basically, while you can indeed see points in every direction, what you see is precisely none of it (in the measure 0 sense).

    This might be a way of cutting up S^2 into nonmeasurable sets. Nor am I sure such an object can exist or be well-defined, it may violate some other property I haven't considered. Assuming you can have a sphere with infinite radius, whatever properties it may have are seriously weird.
    Last edited by Reid; 01-28-2019 at 11:36 PM.

  2. #1242
    Admiral of Awesome
    Posts
    17,620
    Orthographic projections are used in CAD, and by definition for any 2D game. Isometric games (like the old Ultimas, Sim Cities, Diablos, Civilizations) are a special case of orthographic. So it's not really that odd. At least, it's not that unusual.

    As far as projective geometry goes: an orthographic projection is 'just' an affine transformation, so points at infinity behave accordingly (i.e. infinity times a positive number plus another number equals infinity). Perspective projection is not linear; in graphics programming, after applying the "projection matrix" (airquotes) the graphics hardware multiplies U by (1/U.w), which if f=1 is just U.z. So basically perspective projection means points converge toward 0 about as fast as 1/x does, where x is the distance. The point at infinity will only be non-convergent if the angle between you and the infinite-length line is greater than your field of view.
    Last edited by Jon`C; 01-29-2019 at 12:01 AM.

  3. #1243
    In case anyone is following that, when Reid says "measure 0" he means it has no area (in plane geometry these are (edit) points and lines).

    Tait Bryan is a porn star.
    Last edited by Reverend Jones; 01-29-2019 at 12:14 AM.

  4. #1244
    ^^vv<><>BASTART
    Posts
    8,313
    BTW, as an addendum to the above. It's not as complex as I made it out to be. The issue is that parallel lines don't converge to the same point only in Euclidean space, which means to say, only points finitely far away carry the property. Once you add points at infinity, you are no longer in Euclidean space. I tried putting two notions together which don't agree naturally without doing the hard work.

    The question is, then, what does convergence mean in a sphere of infinite radius? Convergence is a topological property, so we need to be able to define the set, define a topology on that set, and define (hopefully in a natural way) what it means for a line inside to converge to a point on the sphere.

    Sparing the boring details, if you attempt this, you find two parallel lines don't converge only when single points on the infinite sphere are open. This, you might recognize, generates the discrete topology. The discrete topology is a bad result. With the discrete topology we are saying that, yeah, the lines don't converge to the same point, but they don't converge to the same point because no sequence converges to x except the sequence {x}. No interesting sequence converges to anything because it's a trivial topology.

    Once you try to define a non-trivial topology, parallel lines converge to the same point. Which is also weird, but less weird.

    The conclusion: "seeing at infinity" in Euclidean space is an ill-defined notion. Once you strip away intuitions and actually work out the topological properties (which a mathematician better than I would have done at step one), you see that things do indeed make sense.
    Last edited by Reid; 02-08-2019 at 12:13 PM.

  5. #1245
    ^^vv<><>BASTART
    Posts
    8,313


    This is the Cantor function. It has derivative zero almost everywhere, i.e. everywhere outside of the Cantor set. It maps a measure 0 set to a measure 1 set. Name it f(x).

    Then define a new function g(x)=f(x)+x, so we sort of stretch the plot of the above up by two. What changes? Well, the measure of the image is now 2. But the measure of the image of the Cantor set doesn't change, it's still measure 1. This is only kind of apparent if you imagine the flat sections as increasing like the function f(x)=x, where you can see now the complement of the Cantor set used to have measure 0 but now has measure 1.

    So, this freak of nature function not only maps a measure 0 set to a measure 1 set, that measure 1 is invariant when you add any strictly increasing *everywhere differentiable* function to it. Now that's what I call straaaange.
    Last edited by Reid; 02-11-2019 at 12:01 PM.

  6. #1246
    Likes Kittens. Eats Fluffies
    Posts
    11,863
    Now that's waht I call whoa dude

  7. #1247
    ^^vv<><>BASTART
    Posts
    8,313
    Quote Originally Posted by saberopus View Post
    Now that's waht I call whoa dude
    Math is full of topics way stranger than any amount of potsmoking can achieve.

  8. #1248
    I also met lots of potheads in the math department.

  9. #1249
    Also if you go to UC Santa Cruz you can have math professors like Ralph Abraham.

  10. #1250
    Likes Kittens. Eats Fluffies
    Posts
    11,863
    Quote Originally Posted by Reid View Post
    Math is full of topics way stranger than any amount of potsmoking can achieve.
    this is like when ppl say 'who needs drugs when i can take a walk in the fresh air and just get high on life'

  11. #1251
    Doesn't care what his title is
    Christmas Cardmaker Extrordinarie

    Posts
    5,167
    i get high on the holy spirit

  12. #1252
    'Weirdness' in mathematics is probably just the arrogance of human intuition subject to logical scrutiny. The right thing to do is to admit that human intuition is faulty and move on.

  13. #1253
    Admiral of Awesome
    Posts
    17,620
    Or maybe weirdness in mathematics is because our axioms have secret contradictions

  14. #1254

  15. #1255
    Some of the weirdness definitely seems to be a mismatch between logic and geometric perception. For example, the Banach-Tarksi Paradox, where you can "disassemble" a ball and reconstruct it into two identical balls, is really not a paradox if you get past the naive temptation to think of physical balls.

  16. #1256
    I mean, math is definitely not like physics in that sense. Otherwise we'd have things like Banach-Tarski therapy for testicular cancer patients.

    (OK, sorry.)

  17. #1257
    Alternatively, one could think of physics and math as different expressions of English law, applied to the physical world in the case of physics, and to the realm of arbitrary intuition in the case of math.

  18. #1258
    ^^vv<><>BASTART
    Posts
    8,313
    Quote Originally Posted by saberopus View Post
    this is like when ppl say 'who needs drugs when i can take a walk in the fresh air and just get high on life'
    who DOES need drugs when you could take a walk in the fresh air and get high on life?

  19. #1259
    ^^vv<><>BASTART
    Posts
    8,313
    Quote Originally Posted by Reverend Jones View Post
    'Weirdness' in mathematics is probably just the arrogance of human intuition subject to logical scrutiny. The right thing to do is to admit that human intuition is faulty and move on.
    This

    Quote Originally Posted by Jon`C View Post
    Or maybe weirdness in mathematics is because our axioms have secret contradictions
    Possibly this but who knows lol. In any case the construction of Cantor's function doesn't depend on choice or any funky axioms, so you're looking at contradicting ZF. If ZF has a contradiction it's gotta be buried veeery deep. Since mathematics exploded, people became much more diligent at trying this sort of thing, so all of the elementary approaches have been exhausted and a few of the non-elementary ones.

    Quote Originally Posted by Reverend Jones View Post
    We'll know if someone derives a contradiction from the ZFC axioms, but we'll never know if one can never be derived

  20. #1260
    ^^vv<><>BASTART
    Posts
    8,313
    Quote Originally Posted by Reverend Jones View Post
    Some of the weirdness definitely seems to be a mismatch between logic and geometric perception. For example, the Banach-Tarksi Paradox, where you can "disassemble" a ball and reconstruct it into two identical balls, is really not a paradox if you get past the naive temptation to think of physical balls.
    Pretty much. It only sounds paradoxical if use colloquial language really inappropriately. I was thinking of this today. Banach-Tarski is often phrased as "cut" a sphere into finitely many pieces. But intuitively, I imagine cutting something like mapping an interval onto a surface and cutting along that. There's a kind of continuous/differentiable/1-manifold dimension to the intuition. When the cheeky ******* says "cut" in Banach-Tarski, what they mean is a peculiar, mathematics-specific partition only formulable properly in set theory. This has no intuitive physical interpretation so calling it cutting is more like wordplay than serious intuition.

    But if they said "this particular mathematical notion of partitioning up mathematical objects is a bit unusual", no one would care would they?

  21. #1261
    ^^vv<><>BASTART
    Posts
    8,313
    Real talk though, going on long walks is truly awesome. And you do get high. Walking endorphins are real. It's also a huge boost to creative thought.



    America needs more pilgrimages or at least more people walking around aimlessly. We'd be mentally better off.

    Drugs are fine though, so long as you know, you study what you're planning to take and accept the risks. I would still recommend staying away from physically addicting substances despite that though.

    BTW, remember how I posted here once about a family friend who got hooked on meth? He's dead. Turned up dead in San Diego a week ago. In two years went from a clean family man, you know, no serious behavioral issues, to destroying his family, career, and now literally his life. Never saw anything so dramatic, fast, or devastating in my life. So yeah, meth is bad. Also opiates seem really bad. But if you want to smoke pot or take acid, go ahead man it's not a big deal. Just go walking afterwards, the double high will rule.

  22. #1262
    ^^vv<><>BASTART
    Posts
    8,313
    Heh. I had two students email almost the exact same email asking for an online homework extension. They said "we are having a tough time because the content was not covered clearly in class". Hmm, well, I go check the student scores and the rest of the class (seriously, all of them) have completed it, with one at 82% but all of the rest at 90%+. So the vast majority of the class did the assignment with no issues.

    I granted them the extension because I'm not an ******* towards my students, but I worded my email to remind them that office hours exist if they'd like explanation on lecture. The politest way of saying "if you're not understanding something come ask me, don't blame my lecture *******" I could think of.

    I guess I am becoming an academic. Passive aggressive emails are the sign.

  23. #1263
    ^^vv<><>BASTART
    Posts
    8,313
    The worst I've seen is a professor sending out an email asking people NOT to schedule seminars in house PLEASE when guest lecturers arrive so that people won't be drawn away and embarrass the guest. To the whole department nonetheless.

  24. #1264
    ^^vv<><>BASTART
    Posts
    8,313
    If you've ever wondered about why ⊗ is used as the symbol for a tensor: it makes sense to think of tensors as products in some sense. If we think of the area of a rectangle as the lengths of its sides a and b, then we express it as ab, the product of the side lengths. Instead denote it as a⊗b.

    Now take another rectangle of side lengths a and c. Since the lengths c and b are abstract, in general we can't "pair up" the sides b and cwith each other to figure out the area of a⊗b and a⊗c. However, since both have a as a side length, we could put the rectangles together along their a-length boundary. What we get is something of area a(b+c). Expressed with our tensor notation above,

    a⊗b+a⊗c=a⊗(b+c)

    As well, the same would be true of some areas a⊗c and b⊗c:

    a⊗c+b⊗c=(a+b)⊗c

    Thus we get the bilinearity property of tensor products.

    Now consider what happens when you "scale" a rectangle a⊗b. If we want to double its area (so instead of ab we have 2ab), then we can distribute the 2 in any number of ways between a and b so long as the coefficients multiply to two. 2(a⊗b)=2a⊗b=a⊗2b=√(2)a⊗√(2)b. Thus the ring action distributes.

    Of course, if we have areas c⊗d and a⊗b without any knowledge of how a,b,c,d interact, then we write the area of c⊗d and a⊗b together as:

    c⊗d+a⊗b

    This is why in general tensors are not primitive tensors but are expressed as sums of tensors.

    All tensors do is take some primitive notions about how areas, volumes, etc. work and apply them to spaces more abstractly. So A⊗B for vector spaces is simply a way of "areas between the vectors of two spaces", without all of the gritty work of calculation getting in the way.

    In case you were curious why we use circle-times as our notation. (a nice analogy holds for this in the direct sum, but it's easier to see).

  25. #1265
    ^^vv<><>BASTART
    Posts
    8,313

  26. #1266
    ^^vv<><>BASTART
    Posts
    8,313
    it's funny because the programmer is bad

  27. #1267
    ^^vv<><>BASTART
    Posts
    8,313
    Reposting:

    Currently using GNU C++ compiler, Notepad++ as an editing environment and use windows batch files for compiling and linking commands. It seems obvious this setup is not the best thing to have, so what are all the cool kids using now for C++?

  28. #1268
    Administrator
    Posts
    7,394
    Vim, bash, and make, man.

  29. #1269
    Admiral of Awesome
    Posts
    17,620
    C++ tooling is an unbridled cluster****. You havenít given nearly enough information about your needs to get a good recommendation.

    If you are a beginner or intermediate C++ developer, you are developing exclusively on Windows, and you are okay with an editor that is very GUI, you should just use Visual Studio.

  30. #1270
    ^^vv<><>BASTART
    Posts
    8,313
    Quote Originally Posted by Brian View Post
    Vim, bash, and make, man.
    Doesn't it take time to learn Vim? Bash is of the question, this is a MinGW install on Windows. And I should probably get into using makefiles but I tend to have rather small projects with few dependencies. It's not a big deal for me to manually write the compiler instructions.

    Quote Originally Posted by Jon`C View Post
    C++ tooling is an unbridled cluster****. You haven’t given nearly enough information about your needs to get a good recommendation.

    If you are a beginner or intermediate C++ developer, you are developing exclusively on Windows, and you are okay with an editor that is very GUI, you should just use Visual Studio.
    Why would Visual Studio be preferred?

    I know I would get access to some nice libraries, so there's that. Otherwise though I find it more annoying to click through menus on compiler than to manually set up my environment.

  31. #1271
    Admiral of Awesome
    Posts
    17,620
    The C++ ďcool kidsĒ are just the people using C++latest. There is no standard workflow. There is no most popular editor. There is no build system with even a clear plurality.

    IDEs are gradually standardizing on CMake for build description interop (but not the build itself). CMake isnít great but itís the best choice right now if you want a portable build. If youíre using Visual Studio you should probably stick to msbuild (the default built in option). If Xcode, whatever it does by default. Otherwise CMake. There is very little reason to write makefiles by hand for building C++ today. Makefiles are the least portable and most error prone option today.

    Generally people on Linux use G++ (GCC), Mac use Clang (Xcode package symlinks cc/gcc/g++ to Clang, so youíre probably using it even if you think you arenít), Windows use Visual C++ (Visual Studio). Recent versions of any of these compilers are very good. Visual C++ has historically had the worst standard compliance, but they have made great improvements in the last few years.

    Clang works on Linux, but compatibility with libstdc++ is questionable. G++ works on Windows but uses libstdc++ instead of the Microsoft one, and the mingw runtime/glibc port instead of the Visual c++ runtime. Because of the way C++ was designed, if you want to link to other C++ libraries you all need to use the same C++ standard library. This is worse on Linux because of how its linker works. There are also issues with mingw about debug information and exceptions, and... well, itís really not worth dealing with any of this. If you should be using an unconventional compiler youíll know.

  32. #1272
    I'd say your first problem is using Windows, and your second is using C++. Just switch to Emacs and Ocaml already.

  33. #1273
    Admiral of Awesome
    Posts
    17,620
    Quote Originally Posted by Reid View Post
    Why would Visual Studio be preferred?

    I know I would get access to some nice libraries, so there's that. Otherwise though I find it more annoying to click through menus on compiler than to manually set up my environment.
    because Visual Studio is the easy way to build code with the Visual C++ compiler. Msbuild (Visual studio build system) projects are onerous to edit by hand, and while you can run CL directly under your own build system this is not a workflow that Microsoft spends much time thinking about. The way MSVC works is at right angles to the way things are traditionally built with makefiles, they do not properly test the command line switches you need to use to get this working (especially in parallel builds), and without the aggressive batching msbuild performs (that no other canned build system does) you canít get good build performance under Windows. They expect you to run it under Visual Studio with a bunch of undocumented environment variables set, using msbuild for batching and the proper subset of switches that msbuild uses, and with tracker.exe attached.

    Thatís not to say itís impossible. Itís just a bad experience. Itís not worth doing unless you canít avoid it. But you need to use CL if you want compatible debug information, to catch exceptions from other libraries, to link to libraries that use std::string as part of their interface (or occasionally even internally....)

  34. #1274
    Administrator
    Posts
    7,394
    It takes time to learn anything. All make is is a bunch of embedded bash anyway. I was only joking, I don't know any C++ beyond what I learned in school eons ago.

  35. #1275
    Make is actually quite a deep but remarkably simple idea (it's basically a DAG), so it's also worth understanding for its own sake and beyond.

  36. #1276
    Admiral of Awesome
    Posts
    17,620
    Iím not gonna **** all over a piece of software that has worked fine for many people for decades. What I will say is that many common build needs violate the fundamental assumptions of Make, causing it to break in surprising ways for people not aware of how the tool really works.

    Among other things, we are talking about C++. Make is not going to be able to build C++20 modules under the most performant implementation proposal. So, from a purely C++ perspective, Make and all other alpha-type build systems are on borrowed time and therefore are really not worth learning if you intend to stick with C++ and arenít going to apply your knowledge for other kinds of build.

    (Noob trap: Make isnít a DAG, itís a directed forest of targets. It assumes a 1:1 correspondence between targets and recipes.

    What does the following do?

    Code:
    foo.txt bar.txt: input.json
        ./generate-files < input.json
    
    .PHONY: all
    all: foo.txt bar.txt
    This makefile runs ./generate-files twice.

    Itís also an error if multiple recipes generate the same target. So even if it could handle the above idea the way you expect, any build that generates targets lazily (which is very helpful for high concurrency) is off the table. You basically have to leave that stuff out of your Makefile build system entirely.

    Both of these things are gonna be required for C++ modules, so bye-bye make.)
    Last edited by Jon`C; 02-28-2019 at 10:09 PM.

  37. #1277
    Admiral of Awesome
    Posts
    17,620
    This sorta circles back to the discussion about why you should use msbuild with Visual C++: Windows has staggering process creation overhead. Visual C++ has gone through a bunch of scalability iterations, but the current best tested model is project level parallelism with msbuild automatically batching CL invocations. Trying to build things the intuitive make way on Windows is brutal.

    Like, the standard for makefiles is to run GCC twice per TU, once to generate header dependencies and a second time to compile an object. Windows has neither the process overhead nor the IO overhead for that ****.

  38. #1278
    In all honesty, the last actual Makefile I wrote was to LaTeX compile my resume. Pretty much every programming language I've used has its own preferred build system, even if the basic idea goes back to Make.

  39. #1279
    ^^vv<><>BASTART
    Posts
    8,313
    Quote Originally Posted by Jon`C View Post
    The C++ “cool kids” are just the people using C++latest. There is no standard workflow. There is no most popular editor. There is no build system with even a clear plurality.
    Alright then. I still don't see if there's any particular reason to buy a Visual Studio License when the Gnu compiler does what I want, though.

    Quote Originally Posted by Reverend Jones View Post
    I'd say your first problem is using Windows, and your second is using C++. Just switch to Emacs and Ocaml already.
    Mostly laziness. I'm familiar with Windows tools, and while I technically do know a bit about Linux, I'm not in the area to set up a new OS and tinker with it.

  40. #1280
    You should try Windows RG.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •