@narain@mathstodon.xyz avatar

narain

@narain@mathstodon.xyz

Associate professor of computer science at IIT Delhi. Computer graphics, numerical methods, bad jokes.

I was on Mastodon before it was cool. But it's nice to have all you cool people here now too.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

dpiponi, to random
@dpiponi@mathstodon.xyz avatar

Given a random number generator that generates points uniformly in the unit interval [0,1] can you generate uniformly distributed points in the unit circle using only algebraic functions? In a finite number of steps - so no rejection sampling, loops, recursion. No "almost always" finite either.

Just wondering about sitiations where it seems you can't avoid trig functions.

narain,
@narain@mathstodon.xyz avatar

@BoydStephenSmithJr @dpiponi But first you need to generate some samples from a normal distribution! It's probably just as hard to do that algebraically.

gregeganSF, (edited ) to random
@gregeganSF@mathstodon.xyz avatar

Are you OK, Science magazine?

“The therapy, an injectable monoclonal antibody callnative to antimalarials used in areas where malaria is endemic; those drugs have to be taed L9LS, offers a possible alterken for several days each month to be protective.”

https://www.science.org/content/article/news-glance-infrared-telescope-debuts-gm-rice-stumbles-maternal-mortality-drops

Edited to add:

This should almost certainly be:

“The therapy, an injectable monoclonal antibody called L9LS, offers a possible alternative to antimalarials used in areas where malaria is endemic; those drugs have to be taken for several days each month to be protective.”

@narain diagnosed inadvertent drag & drop.

narain,
@narain@mathstodon.xyz avatar

@mjambon @gregeganSF Ohhh now it makes sense.

"The therapy, an injectable monoclonal antibody call|native to antimalarials used in areas where malaria is endemic; those drugs have to be ta(ed L9LS, offers a possible alter)ken for several days each month to be protective."

It's an inadvertent drag-and-drop in the word processor. The parenthesised part got moved from its original place at | to where it shouldn't be.

narain, to random
@narain@mathstodon.xyz avatar

I spent a couple hours today working out a Newton method for finding the closest rotation to a given matrix A, i.e. min ‖R − A‖² over R ∈ SO(3). Then I found out that Kugelstadt et al. already figured it out: https://animation.rwth-aachen.de/publication/0561/

Oh well. Glad to verify that I got the same result, but I like my derivation better; it's much shorter :)

narain,
@narain@mathstodon.xyz avatar

@johncarlosbaez Same thing that happens every time you ask Newton's method to find the minimum of a constant function: the gradient and Hessian are both zero and you can't go any further.

narain, to random
@narain@mathstodon.xyz avatar

Hey @lisyarus, I was going through your blog and saw that in your 2D soft-body physics engine post (https://lisyarus.github.io/blog/posts/soft-body-physics.html) you wrote about a technique you derived:

"I don't know a well-established name for this, and a quick google search failed to reveal anything of releavance, so I will call this method /shape matching/. If you know some resources on this, I would love to know them, since I had to derive all the equations myself :)"

Good news: it's literally called shape matching! https://matthias-research.github.io/pages/publications/MeshlessDeformations_SIG05.pdf

(P.S. I know your post is almost a year old, so I'm sorry if someone else has already told you this)

christianp, to firefox
@christianp@mathstodon.xyz avatar

Here's a question:
I have two virtual desktops on Ubuntu. On desktop 1, I have a firefox window with my email and calendar and mastodon tabs. On desktop 2, I have a firefox window with whatever I'm working on.
When I open a GitHub issue from an email, I'd like that tab to be in the window on desktop 2.
At the moment, the only way I know to do it is to drag the tab out of the window, then press ctrl+alt+shift+right to move it to desktop 2, then resize it and drag it onto the existing window there.

On the right-click menu on tabs, there's a "Move tab" submenu, but it doesn't offer the other window as an option, just "new window".
Is this something an extension could help me do?

narain,
@narain@mathstodon.xyz avatar

@christianp This extension seems to do the job (I just tried it out): https://addons.mozilla.org/en-US/firefox/addon/move-tab-to-next-window/

demofox, to random
@demofox@mastodon.gamedev.place avatar

TIL if you do a comb filter (flange kinda) on a video, and invert phase, it amplifies motion. Neat!
https://youtu.be/JSm7Tp8iv3o?si=OcoTiR8ejk33R8p0

narain,
@narain@mathstodon.xyz avatar

@demofox It's basically a edge detection filter / finite difference gradient (convolve with [-1, 0, 1]) except applied in time rather than space.

Which suggests to me that convolving with [-1, 2, -1] (i.e. do sharpening instead of edge detection) may give more naturalistic results...

gregeganSF, (edited ) to random
@gregeganSF@mathstodon.xyz avatar

In differential geometry, if you have coordinates u and v on a surface, and someone talks about “the u-curves”, would you take this to mean:

(A) the various curves of constant u, and varying v
(B) the various curves of constant v, and varying u?

narain,
@narain@mathstodon.xyz avatar

@gregeganSF Surely "u-curve" is analogous to "x-axis"?

narain,
@narain@mathstodon.xyz avatar

@gregeganSF Makes sense. In a ≥3-manifold the u-curves would be unambiguous, and transverse to the u-surfaces.

christianp, to random
@christianp@mathstodon.xyz avatar

who knew that if you multiply a small number by a big number you get a number big enough to worry about?

shaking here

narain,
@narain@mathstodon.xyz avatar

@christianp As someone who works with floating point I only worry if the small number was first created by subtracting two big numbers

(I know what you mean though. Sympathies!)

narain, to random
@narain@mathstodon.xyz avatar

An interesting counterargument to the recent popularizations of geometric algebra as the ideal language for doing geometry in physics, computer graphics, and so on.

I haven't actually worked with GA enough to have an opinion either way, but their basic argument seems compelling:

"1. The wedge product and the rest of Exterior Algebra is 100% amazing, S-tier stuff, definitely something everybody who uses mathematics should know about [...]
2. The geometric product, though, is kinda weird and bad.
3. A lot of other parts of GA are working around the fact that the geometric product is weird and bad.
4. The “better” version of Geometric Algebra [...] which we are... slowly unearthing... will be mostly the same as GA but it will discard the geometric product as a basic operation, to everyone’s benefit. [...]"

https://alexkritchevsky.com/2024/02/28/geometric-algebra.html

j_bertolotti, to physics
@j_bertolotti@mathstodon.xyz avatar


The Lorenz system is a common example of chaotic dynamics and of a strange attractor.
Points with very similar initial conditions initially evolve very similarly to each other, until their trajectories diverge from each other, and start moving on a "butterfly"-shaped fractal.

Trajectories of a number of points following the Lorenz system equations, rendered as yellow tubes.

narain,
@narain@mathstodon.xyz avatar

@j_bertolotti @bleuje But Etienne is correctly concerned that in chaotic dynamics, the error grows exponentially with time, so you would have to stop very quickly! A more relevant result is the shadowing lemma:

"Although a numerically computed chaotic trajectory diverges exponentially from the true trajectory with the same initial coordinates, there exists an errorless trajectory with a slightly different initial condition that stays near ("shadows") the numerically computed one. Therefore, the fractal structure of chaotic trajectories seen in computer maps is real."

https://mathworld.wolfram.com/ShadowingTheorem.html
http://www.scholarpedia.org/article/Shadowing

christianp, to random
@christianp@mathstodon.xyz avatar

They all laughed when I wrote code to simulate long division by hand!

Well, today I had a serious reason to use it.

Who's laughing now?!

(not me, I'm crying about the edge cases)

narain,
@narain@mathstodon.xyz avatar

@christianp What fun!

narain, to random
@narain@mathstodon.xyz avatar

A few months ago I came across a paper about how rational numbers can be represented as LEFT-infinite digit sequences without a decimal point.

For example, in base ten,
−1 = ...9999
because adding 1 to it gives ...0000. Similarly,
1/3 = ...6667
because multiplying it by 3 gives ...0001. It's a fun exercise to verify that 1/3 − 1 = −2/3 indeed holds in this system.

I can't find this paper any more. Does anyone know what it might be?

narain, to random
@narain@mathstodon.xyz avatar

What is the area of a 3D polygon p₁p₂...pₙp₁? If the polygon is non-planar, this is not well-defined: if you split up the polygon into triangles pᵢpⱼpₖ and add up their areas ½‖(pⱼ−pᵢ)×(pₖ×pᵢ)‖, the result depends on the choice of triangulation. However, if you forget to take norms and just add up the vectors ½(pⱼ−pᵢ)×(pₖ×pᵢ) instead, you always get the same result: the "vector area" of the polygon! So if you're dealing with non-planar polygons, or non-planar curves in general, it makes sense to think of area as a vector rather than a scalar.

Further reading: https://en.wikipedia.org/wiki/Vector_area

narain, to random
@narain@mathstodon.xyz avatar

(axiom|Advent|Alexandria)
(of|Ocasio)
(Code|choice|Cortez)

narain, to random
@narain@mathstodon.xyz avatar

Here's a rather niche derivation in computer graphics theory that leads to a surprising and generally interesting fact about spheres. Please tell me if this has been noticed before.

In path tracing of Lambertian (i.e. diffuse) surfaces, we need to perform cosine-weighted sampling of a hemisphere, i.e. choose a point in {(x,y,z) : x² + y² + z² = 1, z ≥ 0} with probability density proportional to z. Depending on how you simplify the equations arising from inversion sampling, you get one of two possible methods:

A.1. Sample a point (x,y) uniformly from the unit disk.
A.2. Project it up to the hemisphere by choosing z = √(1 − x² − y²).

B.1. Sample a point p = (x,y,z) uniformly from the unit sphere.
B.2. Take the unit vector halfway between it and the north pole n = (0,0,1), i.e. (p + n)/‖p + n‖.

It's very strange to me that a routine calculation can be simplified in two different ways to yield two very different geometric interpretations -- in particular, two interpretations that by themselves cannot easily be related to reach other.

In fact, putting them together yields the (non-obvious!) fact that the following bijection between a sphere and a disk is area-preserving, up to a constant factor:

C.1. Given a point on a sphere, take the point halfway between it and the north pole.
C.2. Project it down to the xy-plane to get a point on the unit disk.

Since there is only one such equal-area map with rotational symmetry, we must have just reinvented the Lambert azimuthal equal-area map projection!

johncarlosbaez, (edited ) to random
@johncarlosbaez@mathstodon.xyz avatar

If you draw all roots of all polynomials whose coefficients are ±1, you get an amazing picture that raises lots of challenging puzzles!

I really hope someone reads our short article:

https://www.ams.org/journals/notices/202309/rnoti-p1495.pdf

and solves the main puzzle: why do the fractal regions of this set look so much like "dragon sets"? We have a good heuristic explanation, but no proof yet.

People sometimes get excited about math when they learn about fractals, and then disappointed when they discover rather few professional mathematicians prove theorems about fractals. If you ever wanted to prove a cool theorem about fractals, this could be your chance!

If you read part 2, I'll show you what I'm talking about.

(1/2)

narain, (edited )
@narain@mathstodon.xyz avatar

@gregeganSF @johncarlosbaez There's also an x ↔ −x symmetry in your plot that's absent in Thurston's.

narain,
@narain@mathstodon.xyz avatar

@johncarlosbaez @gregeganSF I found this hard to believe, because Fig 1 in Thurston's paper definitely doesn't look like it has the right symmetries, even inside the unit disk: the fern/tree-like parts on the left and the right look quite different. But on further inspection, I can imagine that the underlying point set could be symmetric although the density distribution is not (maybe some points have more multiplicity on one side than on the other).

narain, to random
@narain@mathstodon.xyz avatar

Cool rainbow effect in the reflection in a metro train window.

What could be the reason for this? I assume it's an LCD screen so the light coming out of it is polarized, but I'm not sure what's going on at the glass interface to cause the colour shift.

narain, to random
@narain@mathstodon.xyz avatar
narain, to random
@narain@mathstodon.xyz avatar

Today I learned that crocodilians are more closely related to birds than to other reptiles. WTF?
https://en.wikipedia.org/wiki/Archosaur

narain, to random
@narain@mathstodon.xyz avatar

If I want spherical geometry but I only have Euclidean geometry, I can get spherical geometry by restricting myself to the unit sphere.

If I want Euclidean geometry but I only have hyperbolic geometry, can I still get Euclidean geometry by restricting myself to some lower-dimensional submanifold?

narain,
@narain@mathstodon.xyz avatar

I think I've found the answer: Coxeter writes¹ that "the intrinsic geometry of the horosphere² is Euclidean", and that this fact was known to Lobachevsky from the beginning.

¹ https://www.thebookshelf.auckland.ac.nz/docs/Maths/PDF/mathschron009-004.pdf
² https://en.wikipedia.org/wiki/Horosphere

narain, to random
@narain@mathstodon.xyz avatar

@christianp Hi Christian, how come I can't follow @dasharez0ne? The account is active (https://mas.to/@dasharez0ne) but via Mathstodon it shows up as suspended (https://mathstodon.xyz/@dasharez0ne@mas.to).

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • kavyap
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • ngwrru68w68
  • GTA5RPClips
  • thenastyranch
  • Youngstown
  • rosin
  • slotface
  • cisconetworking
  • mdbf
  • ethstaker
  • megavids
  • Durango
  • khanakhh
  • cubers
  • anitta
  • osvaldo12
  • everett
  • normalnudes
  • tester
  • tacticalgear
  • provamag3
  • modclub
  • Leos
  • lostlight
  • All magazines