13
\$\begingroup\$

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

\$\endgroup\$
  • 1
    \$\begingroup\$ Aw yiss. Mathjax. \$\endgroup\$ – Draco18s Dec 21 '17 at 20:53
7
\$\begingroup\$

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. Rotate directly towards a target at a constant speed
  6. How Matrix4 represents an object in space and matrix lore
  7. Calculate matrix transformation components separately
  8. Continuous weighted random distribution, biased toward one end
  9. Frustum Culling: How to calculate if an angle is between another two angles
  10. Get local coords from global coords
  11. What's the most optimized way to transform series of points into curves in order to be serialized?
  12. 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)
  13. How To Program a fully controllable spring (Damped) motion
  14. How to find the point on a hypotenuse divinging triangle into two right triangles?
  15. Curvilinear distortion for mapping texture on quad sphere
  16. Computing Normals for a displaced material
  17. Given a constant rotation and target point, find position so that point will be in camera center
  18. Calculate intersect point / aim point
  19. Calculate intersect point / aim point
  20. Calculate intersect point / aim point
  21. "aim at" in 3D space algorithm
  22. Trajectory of a spinning ball
  23. How do I interpret the dot product of non-normalized vectors?
  24. Formula to measure uv-mapping distortion
  25. How do I convert from the global coordinate space to a local space?
  26. Why isn't this physics code scaling velocities separately?

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

You must log in to answer this question.

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