# Interactive Minkowski diagrams tool

Tags:
1. May 14, 2015

### Ibix

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.

2. May 14, 2015

### robphy

Cool!

3. May 14, 2015

### Mentz114

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. May 14, 2015

### PAllen

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.

5. May 14, 2015

### Mentz114

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: May 14, 2015
6. May 15, 2015

### Ibix

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. May 15, 2015

### Orodruin

Staff Emeritus
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.

8. May 15, 2015

### Ibix

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. May 15, 2015

### Mentz114

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. May 15, 2015

### Mentz114

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. May 15, 2015

### Orodruin

Staff Emeritus
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.

12. May 15, 2015

### Mentz114

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. May 15, 2015

### georgir

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: May 15, 2015
14. May 15, 2015

### Ibix

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.

15. May 15, 2015

### Orodruin

Staff Emeritus
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.

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. May 15, 2015

### Ibix

Good idea.

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. May 15, 2015

### Orodruin

Staff Emeritus
Yes. That should be the same as doing consecutive boosts with the same velocity.

18. May 15, 2015

### DrGreg

You would get better spacing by parameterising each hyperbola as$$t = r \cosh (a \tau)\\ x = r \sinh (a \tau)$$where $r$ is constant for each hyperbola and $a$ is constant across all of them. (Or equivalently $v = \tanh (a \tau)$ 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.

19. May 16, 2015

### Ibix

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. May 16, 2015

### Orodruin

Staff Emeritus
Yes, they are equivalent. If your are more comfortable using boosts from the original frame, go with that.