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. :)

A cheat sheet to the syntax is available here: MathJax basic tutorial and quick reference.

A Game Development-specific MathJax guide is being created here by the community: Game Development MathJax Cookbook

  • 1
    Aw yiss. Mathjax. – Draco18s Dec 21 '17 at 20:53

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.

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 paste a link to the post in the Mathjax posts in review chat room that's been set up for this purpose. I will keep an eye on that room and update this post as necessary, others may as well.

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. Find vector tangent to circle through a point
  3. How can I find a point on a line when I have only two other points?
  4. Finding the Distance between 2 Objects
  5. clamp a 2D coordinate to fit within an ellipse
  6. Rotate directly towards a target at a constant speed
  7. How Matrix4 represents an object in space and matrix lore
  8. Calculate matrix transformation components separately
  9. Continuous weighted random distribution, biased toward one end
  10. Frustum Culling: How to calculate if an angle is between another two angles
  11. How can I launch a GameObject at a target if I am given everything except for its launch angle?
  12. Get local coords from global coords
  13. What's the most optimized way to transform series of points into curves in order to be serialized?
  14. 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)
  15. How To Program a fully controllable spring (Damped) motion
  16. How to find the point on a hypotenuse divinging triangle into two right triangles?
  17. Curvilinear distortion for mapping texture on quad sphere
  18. Calculating pitch angle to hit a target using a projectile that has fixed speed
  19. Computing Normals for a displaced material
  20. Given a constant rotation and target point, find position so that point will be in camera center
  21. Calculate intersect point / aim point
  22. Calculate intersect point / aim point
  23. Calculate intersect point / aim point
  24. "aim at" in 3D space algorithm
  25. Trajectory of a spinning ball
  26. How do I interpret the dot product of non-normalized vectors?
  27. Formula to measure uv-mapping distortion
  28. How can I manually construct a right-handed orthographic projection matrix? (would benefit from align, currently replicating that 4-dimensional matrix via a code block)
  29. How do I convert from the global coordinate space to a local space?
  30. Why isn't this physics code scaling velocities separately?
  31. How can I Intercept object with a circular motion
  32. How to achieve cavalier projection using OpenGL fixed pipeline? (matrix notation)
  33. Integration error in high velocity (unicode, array table)
  34. How do I disassemble a 3x3 transformation matrix into rotation and scaling matrices? (matrix notation)
  35. 3D Camera Rotation (matrix notation)
  36. Friction on a rolling ball
  37. Rotating vector3 by a quaternion (and specifically this answer)

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. Using random numbers with a bias (user has explicitly stated they'd rather use MathJax for this answer)
  2. View Matrix FINDING U
  3. Advanced dice probability
  4. How can I move and rotate an object in an “infinity” or “figure 8” trajectory?
  5. How can I move an object in an "infinity" or "figure 8" trajectory?
  6. Converting Euler rotation angles from Z up to Y up (Max to OpenGL)
  7. Why is sin = Y and cosine = X?
  8. How can I prevent small numerical advantages from dominating the balance of an encounter?
  9. Problem with Rotating Third Person Radar UE4
  10. C++ and SFML moving a Sprite with a circle equation
  11. Calculate the distance/number of moves one square is from another
  12. How can I project a vector on another vector?
  13. How does one calculate the surface normal, in 2D collisions?
  14. How does one calculate the surface normal, in 2D collisions? (probably)
  15. How can I project a 3D point onto a 3D line? (uses python out of the blue instead of math formula)
  16. How can I project a 3D point onto a 3D line?
  17. What is Vector Projection and what is it's use in games? (but may be better leaving mathjax inside the diagram)
  18. Three points to normal notation (interpret the math)
  19. Three points to normal notation (interpret the math)
  20. Coordinates of the corners of a rectangle bridging two circles
  21. Difference between column- and row vector matrix multiplication (vector transform)
  22. How to work out the height of a point on a tilted surface?
  23. Merge angle range
  24. Approximating a fourth point with a weighted average between three points?
  25. Timebased transition from start to end value
  26. Timebased transition from start to end value
  27. Hemisphere Projection
  28. Calculate damage values from bullet velocity and size
  29. Determine the z coordinate of a deformed plane based on uv (xy) coordinates
  30. Computing chance of winning when dealing with fuzzy numbers
  31. Computing chance of winning when dealing with fuzzy numbers
  32. Computing chance of winning when dealing with fuzzy numbers
  33. Computing chance of winning when dealing with fuzzy numbers
  34. Parametric form of a cubic function
  35. Parametric form of a cubic function
  36. Parametric form of a cubic function
  37. Time series for creating new events in a PVP game
  38. Why don't Javascript Math.cos doesn't match this vector tutorial?
  39. clamp a 2D coordinate to fit within an ellipse
  40. how to handle the virtual Z axis in 2D games?
  41. How can I prevent small numerical advantages from dominating the balance of an encounter? (benefits from arrays)
  42. Translation Matrix not working properly
  43. How to convert -1 to 1 coordinate back to screen coordinates?
  44. What is a simple algorithm for calculating evenly distributed points on an ellipse?
  45. How to calculate the exit speed of ball bouncing off a solid surface
  46. Ray Intersecting Plane Formula in C++/DirectX
  47. Rotate vector by matrix?
  48. How can I find a point on a line when I have only two other points?
  49. Calculate matrix transformation components separately
  50. How to calculate acceleration and deceleration
  51. How to calculate acceleration and deceleration
  52. How to calculate distance of travel needed get achieve speed x?
  53. How to calculate distance of travel needed get achieve speed x?
  54. Attack vs Defence and who is the winner?
  55. Continuous weighted random distribution, biased toward one end
  56. Get bullet movement direction?
  57. understanding spatial hash function behaviour and Knuth for int64 (would benefit from align)
  58. How to enforce touching within a ring shape?
  59. How do idle games handle such large numbers?
  60. How can I launch a GameObject at a target if I am given everything except for its launch angle?
  61. Test if Jump can reach target
  62. Object orbiting a 3d sphere
  63. Finding pitch/yaw values from lookat vector
  64. Orbital mechanics: orbit as a function of time. Universal variable formulation?
  65. calculating the weights for direction vectors to a target
  66. Adjust Aim Angle for Motion with Accelerating Bullet
  67. How to draw a circle that is around an object and becomes smaller if the player enters it
  68. How to draw a circle that is around an object and becomes smaller if the player enters it
  69. Returning a List of coords for a sphere in order of inside to outside
  70. Explanation of the parameters in the line intersection code
  71. How can I calculate current level from total XP, when each level requires proportionally more XP? (so many equations)
  72. How can I calculate current level from total XP, when each level requires proportionally more XP?
  73. Algorithm for spending x points on y things divided by n people
  74. Exponential EXP Curve | FIXED TIME -> MAX LEVEL
  75. Get all points of a parabola (everything except the code example at the end is formulae)
  76. Calculating the vector to catch a falling object
  77. Find two points in a point cloud with the maximum distance?
  78. Find two points in a point cloud with the maximum distance?
  79. Hex axial coordinates to table coordinates conversion (would benefit from array)
  80. How to work out given two coordinates should I use a vertical/horizontal/diagonal line to connect them
  81. Collision detection with curves
  82. How do you calculate if a line is facing a curve?
  83. How do you calculate the nearest point on 2 curves?
  84. Bezier curve arc length
  85. Moving ships between two planets along a bezier, missing some equations for acceleration
  86. Bezier curve not drawn correctly
  87. Collision detection with curves
  88. Cubic bezier for easing?
  89. Average for damage formula (Min-Max Attack - Min-Max Defense)
  90. Calculate the slope of a 3D triangle?
  91. Calculation correct position of object after collision (2d)
  92. How to find the point on a hypotenuse divinging triangle into two right triangles?
  93. Finding coordinate in radius (pseudocode)
  94. Calculating orbital elements from Cartesian Vectors
  95. Non equi-probable random function
  96. Cannot find bug in frustum culling code (lots of plaintext vector definitions that would be presented far more legibly in mathjax)
  97. Detect if two objects are going to collide (equations would benefit from being legibly expressed in mathjax alongside psuedocode)
  98. Rotating a 3rd person camera toward a target
  99. Fast Ray Sphere collision code
  100. Need some help with math steering behavior stopping on destination point
  101. Is there a quick way to determine if a vector is in a quadrant?
  102. How to invert a damage formula? (maybe)
  103. atan2 : inversed result? (angle 180 is on the right side, angle 0 on the left side)
  104. How can I make a spline out of three points that define circular arc?
  105. Inline-Building a World (SRT) Matrix (maybe)
  106. Determine if Plane is seen by Camera
  107. Understanding normal mapping
  108. Understanding normal mapping
  109. Affine transformation: rotate a plane parallel to another plane
  110. 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)
  111. How to reposition a bouncing ball after it has passed through a surface
  112. How can I test whether points are within a polygon?
  113. How to calculate a direction vector for camera? (probably)
  114. Trajectory of a spinning ball
  115. How do I interpret the dot product of non-normalized vectors?
  116. How can I come up with a simple diminishing return equation?
  117. How can I come up with a simple diminishing return equation?
  118. How can I come up with a simple diminishing return equation?
  119. Formula to measure uv-mapping distortion (would benefit from align)
  120. Gravity: Slow down on ground approach
  121. Percentage of object inside a moving rect
  122. Percentage of object inside a moving rect
  123. 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)
  124. Implicit Functions and extracting an isosurface
  125. Explaining vector math for a pendulum camera
  126. Converting time of day into a smooth day/night variable?
  127. Screen coordinates to isometric coordinates? (maybe)
  128. How do I generate solar systems for a 2d universe map, but still look random
  129. RPG like hit points growth algorithms help
  130. RPG like hit points growth algorithms help
  131. Determining a sensible gear-like hierarchy for a series of connected objects
  132. How to use "weighted average easing" correctly with variable framerate?
  133. How do I convert from the global coordinate space to a local space?
  134. How do I convert from the global coordinate space to a local space?
  135. Find point in 3D plane
  136. How can I find the tangent and normal at an interpolated point on a Catmull-Rom/Hermite spline?
  137. Predicted target location (real code, ought to be accompanied by MathJax)
  138. Using Bullet physics engine to find the moment of object contact before penetration
  139. How do I convert screen coordinates to between -1 and 1? (probably)
  140. Why do we use the Pythagorean theorem in game physics?
  141. How can I compare two quaternions for logical equality?
  142. How can I Intercept object with a circular motion
  143. How do I disassemble a 3x3 transformation matrix into rotation and scaling matrices?
  144. How to rotate vector A around another vector B?
  145. How to rotate vector A around another vector B? (dot product in pseudocode ends up erroneously looking more like a property accessor)
  146. How to tell right from left: Finding the vector pointing towards the right side of a character?
  147. How do I check why is no output on screen? (array tables)
  148. How to find the total bounds rectangle around a list of rectagles
  149. Projecting a light onto a quad (apparent math pseudocode at the beginning is hard to understand)
  150. How can I get a direction vector from a an Euler angle? (pseudocode formula at start of answer)
  151. Intelligently move aircraft using curves
  152. How can I get the normal vector for a plane from a set of vertices?
  153. How can I quantify a drawn line's straightness?
  154. How can I rotate about an arbitrary point in 3D (instead of the origin)?
  155. Implementing framerate independence
  • Other people can't edit this, since it's not CW. – wizzwizz4 Dec 20 '17 at 16:31
  • @wizzwizz4 I've made it CW. I didn't realise CW was easier to edit on meta, hooray! – doppelgreener Dec 20 '17 at 16:40
  • 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.) – John Hamilton Dec 21 '17 at 7:18
  • 1
    @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. – doppelgreener Dec 21 '17 at 9:00
  • Might be worthwhile to check the list produced by this search about images hosted on Wikipedia. – Alexandre Vaillancourt Aug 22 at 1:05

You must log in to answer this question.

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