pigeon being thrown bread crumbs: "aww yiss, motha flippin mathjax!!"

MathJax has been enabled on our site!

That means we can have actual fancy mathematical equations expressed as such without resorting to pseudocode, uneditable \$\LaTeX\$ screenshots, etc. MathJax is derived from LaTeX, but not exactly equal to it. (It's generally off topic on TeX Stack Exchange.)

What's this do?

Basically, we can fancify our equations:

$$ E = mc^2 $$

We can wrap our equations in \$ ... \$ (for an inline equation: \$c^2 = a^2 + b^2\$), or if we want it to take up its own lines or be multiline we can use the $$ ... $$ delimiters instead.

This also lets us write equations with some significant visual complexity:

$$ \begin{align} \vec{v} &= \begin{pmatrix} x \\ y \\ z \end{pmatrix} \\ \vert{\vec{v}}\vert &= \sqrt{x^2 + y^2 + z^2} \end{align} $$

The rule of thumb is that LaTeX makes extremely complex stuff simple, and extremely simple stuff complex. :)

References are available here:


1 Answer 1


The MathJax todo list

We have a list of posts we previously identified as being solid candidates for MathJax. We should do some editing to convert those to use mathematical formulae.

Please work on the ones you can confidently work on as necessary. Once you've edited a post, delete it from this list.

Some posts that are logged here will not need MathJax at all. They are here because when compiling the case for adding MathJax to the site, we (or I) believed that if we had MathJax when the post was written then it may have been written differently to use it. However, the post having been written now may be OK as-is and not need changes. If you encounter one of these posts in this list please remove it even without edits.

What do we change or not change?

  • If a post is displaying complex mathematical equations or notation that would benefit from being laid out in MathJax instead, convert those equations to MathJax.
  • If a post is displaying minimal simple math (e.g. "a = 1 + 2") it's not really worth converting to MathJax.
  • Do not replace pseudocode with Mathjax. Pseudocode is intended to be easily translated into actual computer code, sometimes even copy-pasted with minimal adjustments. Replacing it with MathJax would be a detriment to our site's utility.
  • Do augment pseudocode with adjacent MathJax, when the mathematical notation would help people understand what's going on in the pseudocode. There are many equations that are simple to express as an equation, but complex and difficult to read when expressed as code. If it's not one of these cases (the mathematical equation is either more difficult to read than the code, or adds no net benefit in legibility) probably don't worry about this.

Sometimes the line between points 1 and 3 will be blurry. Use your judgement or request feedback from your peers in game development chat.

For users whose edits need review

If you don't have the >2k edit privilege then when you submit an edit, please leave a comment in the Edit Summary field before submitting so that whoever approves your edit can also update this page accordingly.

The "definite" list

These posts were identified as definitely beneficial from mathjax, because they were already using plaintext or images for equations or would otherwise clearly benefit from mathjax. Where these posts contain pseudocode, be mindful of whether it should be replaced with mathjax or augmented with it, per our guidance above.

  1. How do I detect the direction of 2D rectangular object collisions?

  2. Path following with Asteroids-like movement. Time to complete path ( potentially — or user could've preferred keeping the latex markup intact in the diagrams anyway)

  3. How To Program a fully controllable spring (Damped) motion

  4. Calculate intersect point / aim point

The "probably" list

These posts were identified as potentially strongly benefitting from mathjax, but may not be simple to convert: these were answers using psuedocode that may be more cleanly expressed as a mathematical equation, or would be better accompanied by an equation.

If you don't feel like a post on this list should be modified, please strike it out with <s> ... </s> rather than remove it.

  1. View Matrix FINDING U
  2. How can I move and rotate an object in an “infinity” or “figure 8” trajectory?
  3. How can I move an object in an "infinity" or "figure 8" trajectory?
  4. Converting Euler rotation angles from Z up to Y up (Max to OpenGL)
  5. Problem with Rotating Third Person Radar UE4
  6. How can I project a vector on another vector?
  7. What is Vector Projection and what is it's use in games? (but may be better leaving mathjax inside the diagram)
  8. How to work out the height of a point on a tilted surface?
  9. Hemisphere Projection
  10. Determine the z coordinate of a deformed plane based on uv (xy) coordinates
  11. Computing chance of winning when dealing with fuzzy numbers
  12. Computing chance of winning when dealing with fuzzy numbers
  13. Computing chance of winning when dealing with fuzzy numbers
  14. Computing chance of winning when dealing with fuzzy numbers
  15. Time series for creating new events in a PVP game
  16. how to handle the virtual Z axis in 2D games?
  17. How can I prevent small numerical advantages from dominating the balance of an encounter? (benefits from arrays)
  18. Translation Matrix not working properly
  19. What is a simple algorithm for calculating evenly distributed points on an ellipse?
  20. How to calculate the exit speed of ball bouncing off a solid surface
  21. Ray Intersecting Plane Formula in C++/DirectX
  22. Rotate vector by matrix?
  23. How can I find a point on a line when I have only two other points?
  24. Calculate matrix transformation components separately
  25. How to calculate distance of travel needed get achieve speed x?
  26. How to calculate distance of travel needed get achieve speed x?
  27. Attack vs Defence and who is the winner?
  28. Continuous weighted random distribution, biased toward one end
  29. understanding spatial hash function behaviour and Knuth for int64 (would benefit from align)
  30. How do idle games handle such large numbers?
  31. How can I launch a GameObject at a target if I am given everything except for its launch angle?
  32. Test if Jump can reach target
  33. Object orbiting a 3d sphere
  34. Finding pitch/yaw values from lookat vector
  35. Orbital mechanics: orbit as a function of time. Universal variable formulation?
  36. calculating the weights for direction vectors to a target
  37. Adjust Aim Angle for Motion with Accelerating Bullet
  38. How to draw a circle that is around an object and becomes smaller if the player enters it
  39. How to draw a circle that is around an object and becomes smaller if the player enters it
  40. Returning a List of coords for a sphere in order of inside to outside
  41. Explanation of the parameters in the line intersection code
  42. How can I calculate current level from total XP, when each level requires proportionally more XP? (so many equations)
  43. How can I calculate current level from total XP, when each level requires proportionally more XP?
  44. Algorithm for spending x points on y things divided by n people
  45. Exponential EXP Curve | FIXED TIME -> MAX LEVEL
  46. Calculating the vector to catch a falling object
  47. Find two points in a point cloud with the maximum distance?
  48. Find two points in a point cloud with the maximum distance?
  49. Hex axial coordinates to table coordinates conversion (would benefit from array)
  50. How to work out given two coordinates should I use a vertical/horizontal/diagonal line to connect them
  51. Collision detection with curves
  52. How do you calculate if a line is facing a curve?
  53. How do you calculate the nearest point on 2 curves?
  54. Bezier curve arc length
  55. Moving ships between two planets along a bezier, missing some equations for acceleration
  56. Bezier curve not drawn correctly
  57. Collision detection with curves
  58. Cubic bezier for easing?
  59. Average for damage formula (Min-Max Attack - Min-Max Defense)
  60. Calculate the slope of a 3D triangle?
  61. Calculation correct position of object after collision (2d)
  62. How to find the point on a hypotenuse divinging triangle into two right triangles?
  63. Finding coordinate in radius (pseudocode)
  64. Calculating orbital elements from Cartesian Vectors
  65. Non equi-probable random function
  66. Cannot find bug in frustum culling code (lots of plaintext vector definitions that would be presented far more legibly in mathjax)
  67. Detect if two objects are going to collide (equations would benefit from being legibly expressed in mathjax alongside psuedocode)
  68. Rotating a 3rd person camera toward a target
  69. Need some help with math steering behavior stopping on destination point
  70. Is there a quick way to determine if a vector is in a quadrant?
  71. How to invert a damage formula? (maybe)
  72. atan2 : inversed result? (angle 180 is on the right side, angle 0 on the left side)
  73. How can I make a spline out of three points that define a circular arc?
  74. Inline-Building a World (SRT) Matrix (maybe)
  75. Determine if Plane is seen by Camera
  76. Understanding normal mapping
  77. Understanding normal mapping
  78. Affine transformation: rotate a plane parallel to another plane
  79. What is the simplest way to calculate distance in a 3D environment? (provides native formula + implementation pseudocode already; native formula would be better off as mathjax)
  80. How to reposition a bouncing ball after it has passed through a surface
  81. How can I test whether points are within a polygon?
  82. How to calculate a direction vector for camera? (probably)
  83. Trajectory of a spinning ball
  84. How do I interpret the dot product of non-normalized vectors?
  85. How can I come up with a simple diminishing return equation?
  86. How can I come up with a simple diminishing return equation?
  87. How can I come up with a simple diminishing return equation?
  88. Formula to measure uv-mapping distortion (would benefit from align)
  89. Gravity: Slow down on ground approach
  90. Percentage of object inside a moving rect
  91. Percentage of object inside a moving rect
  92. How do I calculate the distance between a point and a rotated rectangle? (real code; would benefit from being annotated with mathjax as the operation is fairly simple)
  93. Implicit Functions and extracting an isosurface
  94. Explaining vector math for a pendulum camera
  95. Converting time of day into a smooth day/night variable?
  96. Screen coordinates to isometric coordinates? (maybe)
  97. How do I generate solar systems for a 2d universe map, but still look random
  98. RPG like hit points growth algorithms help
  99. How to use "weighted average easing" correctly with variable framerate?
  100. How do I convert from the global coordinate space to a local space?
  101. How do I convert from the global coordinate space to a local space?
  102. How can I find the tangent and normal at an interpolated point on a Catmull-Rom/Hermite spline?
  103. Predicted target location (real code, ought to be accompanied by MathJax)
  104. Using Bullet physics engine to find the moment of object contact before penetration
  105. Why do we use the Pythagorean theorem in game physics?
  106. Projecting a light onto a quad (apparent math pseudocode at the beginning is hard to understand)
  107. How can I rotate about an arbitrary point in 3D (instead of the origin)?
  • \$\begingroup\$ We should find a way to tell converted posts apart from the ones that are not, so that this can also become a way to track which ones are done and which are not (ex. make the ones that are done italic, or make the ones that are not done bold, I tried using ascii striket̶h̶r̶o̶u̶g̶h̶ but that just breaks the notation we use to make the post shorter.) \$\endgroup\$ Commented Dec 21, 2017 at 7:18
  • 1
    \$\begingroup\$ @John The "done" posts ought to get deleted off the list by the people completing them; if the edit needs review others can also keep an eye on it if it's posted to the linked chat room. \$\endgroup\$ Commented Dec 21, 2017 at 9:00
  • \$\begingroup\$ Might be worthwhile to check the list produced by this search about images hosted on Wikipedia. \$\endgroup\$
    – Vaillancourt Mod
    Commented Aug 22, 2018 at 1:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .