Interactive Minkowski diagrams tool

In summary, this is an interactive Minkowski diagram website with HTML5 features. It allows users to add events and connect them with straight-line paths, then boost to a specified velocity or rest frame of a time-like path. The page also includes instructions and buttons for creating textbook diagrams. However, it may not work on older browsers or those that do not support <input type="color"> tag. Users are welcome to leave comments, and the creator is currently working on fixing a bug and adding grid and hyperbolae buttons as suggested by a user.
  • #1
Ibix
Science Advisor
Insights Author
11,806
13,490
This is a little toy I put together that I thought might be of interest:
http://ibises.org.uk/Minkowski.html

It's an interactive Minkowski diagram. You can add events and connect them up with straight-line paths, then Lorentz boost either to a specified velocity or to the rest frame of a time-like path. Below the diagram there are instructions (which I hope make sense) and some buttons that create some textbook diagrams.

The page uses HTML5 features, so you'll need a fairly up-to-date browser - if you don't see axes and a grid, that's bad. Also, I gather that not all browsers implement the <input type="color"> tag. I think the page will work anyway, but you may require a resource such as this one to set the colours if you're not familiar with hex triplet notation.

Any comments (physics or otherwise) welcome.
 
  • Like
Likes Amrator, Khashishi, David Horgan and 5 others
Physics news on Phys.org
  • #3
I bet that took more than 10 min to put together. IE does not support colour inputs as far as I know. Works fine in FF.
 
  • #4
I use firefox, but for me, all the pre-selected diagrams work, but no actions on the grid itself work: click, shif-click, drag all do nothing for me.
 
  • Like
Likes Ibix
  • #5
I've been debugging and on line 437 (in the canvasClick event handler) 'event' is undefined. I can't see why because the code is the same as we all use to get the event parameters.

I hope Ibix can sort it out.
[later]

I found a solution. The 'onclick' attribute should be written ' onclick="canvasClick(event)" '. This applies to all the event handler attributes. Include the event in the declaration.

I changed them and the clicking and dragging works fine now. Looks good and I'll try it properly soon.
 
Last edited:
  • Like
Likes Ibix
  • #6
Thanks Mentz. I'll aim to fix it this evening. I must say that events in Javascript seem to Just Happen in Chrome/Opera. Presumably their Javascript engines are slightly more permissive in how events are handled than Firefox's (?).

It did take more than ten minutes to put together, yes, although the actual physics took a lot less. That's entirely contained in the LT and LTv functions, which boost events and velocities. The rest of the program is book-keeping and user interface.
 
  • #7
Neat! It reminds me of something I have thought of doing but never found the time to.

One thing that would be nice would be to include an auto button for making a space-time grid (i.e., just lines parallel to the time and space axes). I think it would be instructive to see how it changes under boosts.

Another thing that might be more difficult would be the possibility to draw hyperbolae and to see how they don't change under boosts.
 
  • Like
Likes Ibix
  • #8
Orodruin said:
Neat! It reminds me of something I have thought of doing but never found the time to.

One thing that would be nice would be to include an auto button for making a space-time grid (i.e., just lines parallel to the time and space axes). I think it would be instructive to see how it changes under boosts.

Another thing that might be more difficult would be the possibility to draw hyperbolae and to see how they don't change under boosts.
The grid is easy. To the extent that you can approximate a hyperbola by a set of straight lines connecting a relatively small number of events lying on the hyperbola, that's not too hard either.
 
  • #9
Orodruin said:
Another thing that might be more difficult would be the possibility to draw hyperbolae and to see how they don't change under boosts.
Interesting. I have a picture in my mind of a hyperbola on an ST diagram with a straight line (ICMIRF) touching it at a point E. Now if we boost the diagram to make our ICMIRF stationary ( ie vertical) won't the parabola have to rotate to still go through point E ?

Or have I just drunk too much coffee ?
 
  • #10
Ibix said:
Thanks Mentz. I'll aim to fix it this evening. I must say that events in Javascript seem to Just Happen in Chrome/Opera. Presumably their Javascript engines are slightly more permissive in how events are handled than Firefox's (?).

It did take more than ten minutes to put together, yes, although the actual physics took a lot less. That's entirely contained in the LT and LTv functions, which boost events and velocities. The rest of the program is book-keeping and user interface.
Yes making interfaces is a pain and you've done decent job of it. With the changes you'll have all the major browsers covered.
 
  • #11
Mentz114 said:
Interesting. I have a picture in my mind of a hyperbola on an ST diagram with a straight line (ICMIRF) touching it at a point E. Now if we boost the diagram to make our ICMIRF stationary ( ie vertical) won't the parabola have to rotate to still go through point E ?

Or have I just drunk too much coffee ?
Of course different points on the hyperbola will be at different points after the boosts. The hyperbola will be left invariant in the same sense as a circle is invariant under rotations.
 
  • Like
Likes Ibix
  • #12
Orodruin said:
Of course different points on the hyperbola will be at different points after the boosts. The hyperbola will be left invariant in the same sense as a circle is invariant under rotations.
Right, I see what you mean. I have a program that boosts hyperbolas and now that I look carefully I can see the shape is the same.
 
  • #13
You seem to have a javascript error - you are setting up event handlers without an event parameter. That only works in IE and Chrome as they have a global event variable, but not in Firefox or any browsers that stick to the standards.
Edit: I should've read a few more posts before commenting. I see you are already aware of this issue, so just disregard my post. And sorry for the hasty posting.
 
Last edited:
  • Like
Likes Ibix
  • #14
I've installed Firefox, corrected the bug and added grid and hyperbolae buttons at Orodruin's suggestion. I think I can make the events along the innermost hyperbolae a bit more evenly distributed (they're very clustered in the middle), but my brain doesn't seem to be able to handle such complex maths tonight (I know it's not complex, I'm just tired).

Lesson learned, anyway. Test in as heterogeneous environment as humanly possible. I see there's a Safari for Windows - I should probably test that at some point.
 
  • Like
Likes Orodruin
  • #15
Ibix said:
hyperbolae
You might want to add in the description that the hyperbolae crossing the x-axis correspond to the world lines of constant proper acceleration, perhaps identifying them with a different colour.

Ibix said:
I think I can make the events along the innermost hyperbolae a bit more evenly distributed (they're very clustered in the middle), but my brain doesn't seem to be able to handle such complex maths tonight (I know it's not complex, I'm just tired).

I assume you simply took equal hyperbolic distance between them? I think this is fine, it transforms well and you need more points in the middle because the hyperbolae are more curved there.
 
  • #16
Orodruin said:
You might want to add in the description that the hyperbolae crossing the x-axis correspond to the world lines of constant proper acceleration, perhaps identifying them with a different colour.
Good idea.

Orodruin said:
I assume you simply took equal hyperbolic distance between them? I think this is fine, it transforms well and you need more points in the middle because the hyperbolae are more curved there.
The events along each hyperbola are generated by boosting either (x,0) or (0,t) into the frame moving at v=0.99j, j=-10,-9...,9,10. I'm not precisely sure what you mean by hyperbolic distance - the integral of ##\sqrt{ds^2}## along the hyperbola?

The events seem a little more tightly clustered than is warranted by the (not extreme) curvature of the hyperbolae. I might have a play with it tomorrow. Going to bed now...
 
  • #17
Ibix said:
The events along each hyperbola are generated by boosting either (x,0) or (0,t) into the frame moving at v=0.99j, j=-10,-9...,9,10. I'm not precisely sure what you mean by hyperbolic distance - the integral of ds2‾‾‾\sqrt{ds^2} along the hyperbola?

Yes. That should be the same as doing consecutive boosts with the same velocity.
 
  • Like
Likes Ibix
  • #18
Ibix said:
The events along each hyperbola are generated by boosting either (x,0) or (0,t) into the frame moving at v=0.99j, j=-10,-9...,9,10. I'm not precisely sure what you mean by hyperbolic distance - the integral of ##\sqrt{ds^2}## along the hyperbola?

The events seem a little more tightly clustered than is warranted by the (not extreme) curvature of the hyperbolae. I might have a play with it tomorrow. Going to bed now...
You would get better spacing by parameterising each hyperbola as[tex]
t = r \cosh (a \tau)\\
x = r \sinh (a \tau)
[/tex]where [itex]r[/itex] is constant for each hyperbola and [itex]a[/itex] is constant across all of them. (Or equivalently [itex] v = \tanh (a \tau) [/itex] in your method.) This way, the local event density won't change. I've never programmed in Java, but a quick Google shows that it has sinh, cosh and tanh functions.
 
  • Like
Likes Ibix
  • #19
Orodruin said:
Yes. That should be the same as doing consecutive boosts with the same velocity.
I'm boosting my initial point every time, rather than consecutive boosts. I see there's a typo in my last that may be confusing things. The correct statement is that for each j, j=-10,-9,...,9,10, I'm starting with the point (x,0) or (0,t) in the frame S, which is the initial frame of the diagram, then boosting it to v=0.099j, and adding an event using the boosted coordinates (in frame S).

I'll try your way, starting with (0,t) or (x,0) and boosting it to v=0.1, then boosting that to v=0.1, etc. I'll also try @Dr. Greg 's method, which I suspect (without actually having done the maths) will give the same result since we're talking about hyperbolic rotations.
 
  • #20
Ibix said:
I'll try your way, starting with (0,t) or (x,0) and boosting it to v=0.1, then boosting that to v=0.1, etc. I'll also try @Dr. Greg 's method, which I suspect (without actually having done the maths) will give the same result since we're talking about hyperbolic rotations.

Yes, they are equivalent. If your are more comfortable using boosts from the original frame, go with that.
 
  • #21
I use firefox 38, everything works fine.
Anyway, its nice, thanks Ibix.
 
  • #22
Everything is fine for me as soon as the event fixes were put in.
 
  • #23
Just one point. When I boost the hyperbolae to near c, its revelead to be too short. You should make a much longer hyperbolae to show that it remains invariant when boosted to arbitrarily high speeds.
 
  • #24
Shyan said:
Just one point. When I boost the hyperbolae to near c, its revelead to be too short. You should make a much longer hyperbolae to show that it remains invariant when boosted to arbitrarily high speeds.

That would involve infinitely many points per hyperbola ...
 
  • #25
Orodruin said:
That would involve infinitely many points per hyperbola ...
Yeah, my bad wording. I just meant right now, even when boosted to v=0.5c, the hyperbolae appears to be short. He can just choose a higher maximum speed and correct the length of the hyperbolae for that maximum speed.
 
  • Like
Likes Ibix
  • #26
I've switched to DrGreg's parameterisation, changed the colour of the time-like paths and added a note about their physical meaning as Orodruin suggested, extended the hyperbolae as Shyan suggested (you can boost to 0.99c once without seeing them; you can't do it twice though) and added the pair of null paths through the origin for completeness.
 
Last edited:
  • Like
Likes ShayanJ and Orodruin
  • #27
Ibix said:
I've switched to DrGreg's parameterisation, changed the colour of the time-like paths and added a note about their physical meaning as Orodruin suggested, extended the hyperbolae as Shyan suggested (you can boost to 0.99c once without seeing them; you can't do it twice though) and added the pair of null paths through the origin for completeness.
At the rist of complicating the diagram too much, you might also like to consider drawing lines from the events through the origin -- the events along different curves are already lined up for this. For the green area, this would then be a grid for Rindler coordinates -- see the first diagram in the Wikipedia Rindler coordinates article.

The whole diagram would then be the Minkowski geometry equivalent of a rotating wheel with spokes in Euclidean geometry.
 
  • Like
Likes nnunn
  • #28
Cool
 
  • #29
Selecting a scenario doesn't choose a velocity to boost, at least for me.

I think you should include an example of how to read the diagrams for some of the secarios, and how the diagram explains or not the paradox.
 
  • #30
Looks good on my chromebook and is pretty interesting to play around with!
 
  • #31
dipole said:
Selecting a scenario doesn't choose a velocity to boost, at least for me.
I didn't expect it to. You should, however, be able to click on a time-like line (one steeper than 45 degrees) and then click on the "Boost to selected line rest frame" button to boost to the frame where that line is vertical. If not, let me know.

dipole said:
I think you should include an example of how to read the diagrams for some of the secarios, and how the diagram explains or not the paradox.
It did occur to me - maybe next week. The short version is that you are looking at a displacement-time graph, with time vertical and displacement horizontal. Something stationary gives a vertical line; something traveling at c gives a 45 degree sloped line. In Newtonian physics, you could transform into the rest frame of a moving object by shearing the graph until the line of interest was vertical. In Einsteinian physics, the transform is a little more complex - and these diagrams are a great way to start building up intuition for what the Lorentz transforms are doing.
 
  • Like
Likes nnunn
  • #32
DrGreg said:
At the rist of complicating the diagram too much, you might also like to consider drawing lines from the events through the origin -- the events along different curves are already lined up for this. For the green area, this would then be a grid for Rindler coordinates -- see the first diagram in the Wikipedia Rindler coordinates article.

The whole diagram would then be the Minkowski geometry equivalent of a rotating wheel with spokes in Euclidean geometry.
No time right now (could do with time-dilating my office), but I think it's worth a look. I think I might do that as another button, since it might get a bit busy, as you say.
 
  • #33
I actually worked on a relativity simulator like this a couple years ago: http://www.refsmmat.com/jsphys/relativity/relativity.html

Different idea, though. Instead of letting the user construct a Minkowski diagram, it has a set of built-in scenarios (common teaching examples). It can display the Minkowski diagram or a 2D view of the scene. We also added in Doppler shifting for fun -- if you switch on "Apparent positions" in the Settings menu, you'll see the locations of objects as they would be seen from the cross mark at the center of the screen.

I used it a couple of times in a modern physics course to show examples, but now I've moved out of physics and don't have a good use for it. It's open source, so feel free to play with it.
 
  • #34
DrGreg said:
At the rist of complicating the diagram too much, you might also like to consider drawing lines from the events through the origin -- the events along different curves are already lined up for this. For the green area, this would then be a grid for Rindler coordinates -- see the first diagram in the Wikipedia Rindler coordinates article.

The whole diagram would then be the Minkowski geometry equivalent of a rotating wheel with spokes in Euclidean geometry.
Done! There are two buttons, one for hyperbolae only and one for hyperbolae with spokes. It's quite hypnotic to watch them boosting.
 
  • Like
Likes DrGreg
  • #35
Very nice, I have put it in my bookmarks. Thanks for posting.
 

1. What is an Interactive Minkowski Diagrams Tool?

An Interactive Minkowski Diagrams Tool is a computer program or software that allows scientists and researchers to plot and analyze Minkowski diagrams in real-time. Minkowski diagrams are graphical representations of the space-time continuum, which is a fundamental concept in the theory of relativity.

2. How does an Interactive Minkowski Diagrams Tool work?

An Interactive Minkowski Diagrams Tool works by using mathematical equations and algorithms to plot points on a graph representing the space-time continuum. The tool allows users to input different parameters, such as velocity and time, and see the corresponding changes in the diagram in real-time.

3. What are the benefits of using an Interactive Minkowski Diagrams Tool?

Using an Interactive Minkowski Diagrams Tool can help scientists and researchers better understand the concept of space-time and its relationship with velocity and time. It can also aid in visualizing and analyzing complex theories and equations in the field of relativity.

4. Can an Interactive Minkowski Diagrams Tool be used for other purposes?

While an Interactive Minkowski Diagrams Tool is primarily used in the study of relativity, it can also have other applications. For example, it can be used in engineering and physics to analyze the behavior of particles moving at high speeds or in the study of black holes and other astrophysical phenomena.

5. Is an Interactive Minkowski Diagrams Tool user-friendly?

Most Interactive Minkowski Diagrams Tools are designed to be user-friendly, with a user-friendly interface and easy-to-understand controls. However, some knowledge of relativity and mathematical concepts may be required to fully utilize the tool and interpret the results accurately.

Similar threads

  • Special and General Relativity
Replies
6
Views
1K
  • Special and General Relativity
Replies
5
Views
1K
  • Programming and Computer Science
Replies
6
Views
5K
Back
Top