18
\$\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. :)

References are available here:

| |
\$\endgroup\$
10
\$\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.

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. Frustum Culling: How to calculate if an angle is between another two angles
  3. 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)
  4. How To Program a fully controllable spring (Damped) motion
  5. Calculate intersect point / aim point
  6. 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. Why is sin = Y and cosine = X?
  6. Problem with Rotating Third Person Radar UE4
  7. How can I project a vector on another vector?
  8. What is Vector Projection and what is it's use in games? (but may be better leaving mathjax inside the diagram)
  9. How to work out the height of a point on a tilted surface?
  10. Approximating a fourth point with a weighted average between three points?
  11. Timebased transition from start to end value
  12. Timebased transition from start to end value
  13. Hemisphere Projection
  14. Calculate damage values from bullet velocity and size
  15. Determine the z coordinate of a deformed plane based on uv (xy) coordinates
  16. Computing chance of winning when dealing with fuzzy numbers
  17. Computing chance of winning when dealing with fuzzy numbers
  18. Computing chance of winning when dealing with fuzzy numbers
  19. Computing chance of winning when dealing with fuzzy numbers
  20. Time series for creating new events in a PVP game
  21. how to handle the virtual Z axis in 2D games?
  22. How can I prevent small numerical advantages from dominating the balance of an encounter? (benefits from arrays)
  23. Translation Matrix not working properly
  24. How to convert -1 to 1 coordinate back to screen coordinates?
  25. What is a simple algorithm for calculating evenly distributed points on an ellipse?
  26. How to calculate the exit speed of ball bouncing off a solid surface
  27. Ray Intersecting Plane Formula in C++/DirectX
  28. Rotate vector by matrix?
  29. How can I find a point on a line when I have only two other points?
  30. Calculate matrix transformation components separately
  31. How to calculate distance of travel needed get achieve speed x?
  32. How to calculate distance of travel needed get achieve speed x?
  33. Attack vs Defence and who is the winner?
  34. Continuous weighted random distribution, biased toward one end
  35. understanding spatial hash function behaviour and Knuth for int64 (would benefit from align)
  36. How do idle games handle such large numbers?
  37. How can I launch a GameObject at a target if I am given everything except for its launch angle?
  38. Test if Jump can reach target
  39. Object orbiting a 3d sphere
  40. Finding pitch/yaw values from lookat vector
  41. Orbital mechanics: orbit as a function of time. Universal variable formulation?
  42. calculating the weights for direction vectors to a target
  43. Adjust Aim Angle for Motion with Accelerating Bullet
  44. How to draw a circle that is around an object and becomes smaller if the player enters it
  45. How to draw a circle that is around an object and becomes smaller if the player enters it
  46. Returning a List of coords for a sphere in order of inside to outside
  47. Explanation of the parameters in the line intersection code
  48. How can I calculate current level from total XP, when each level requires proportionally more XP? (so many equations)
  49. How can I calculate current level from total XP, when each level requires proportionally more XP?
  50. Algorithm for spending x points on y things divided by n people
  51. Exponential EXP Curve | FIXED TIME -> MAX LEVEL
  52. Get all points of a parabola (everything except the code example at the end is formulae)
  53. Calculating the vector to catch a falling object
  54. Find two points in a point cloud with the maximum distance?
  55. Find two points in a point cloud with the maximum distance?
  56. Hex axial coordinates to table coordinates conversion (would benefit from array)
  57. How to work out given two coordinates should I use a vertical/horizontal/diagonal line to connect them
  58. Collision detection with curves
  59. How do you calculate if a line is facing a curve?
  60. How do you calculate the nearest point on 2 curves?
  61. Bezier curve arc length
  62. Moving ships between two planets along a bezier, missing some equations for acceleration
  63. Bezier curve not drawn correctly
  64. Collision detection with curves
  65. Cubic bezier for easing?
  66. Average for damage formula (Min-Max Attack - Min-Max Defense)
  67. Calculate the slope of a 3D triangle?
  68. Calculation correct position of object after collision (2d)
  69. How to find the point on a hypotenuse divinging triangle into two right triangles?
  70. Finding coordinate in radius (pseudocode)
  71. Calculating orbital elements from Cartesian Vectors
  72. Non equi-probable random function
  73. Cannot find bug in frustum culling code (lots of plaintext vector definitions that would be presented far more legibly in mathjax)
  74. Detect if two objects are going to collide (equations would benefit from being legibly expressed in mathjax alongside psuedocode)
  75. Rotating a 3rd person camera toward a target
  76. Need some help with math steering behavior stopping on destination point
  77. Is there a quick way to determine if a vector is in a quadrant?
  78. How to invert a damage formula? (maybe)
  79. atan2 : inversed result? (angle 180 is on the right side, angle 0 on the left side)
  80. How can I make a spline out of three points that define a circular arc?
  81. Inline-Building a World (SRT) Matrix (maybe)
  82. Determine if Plane is seen by Camera
  83. Understanding normal mapping
  84. Understanding normal mapping
  85. Affine transformation: rotate a plane parallel to another plane
  86. 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)
  87. How to reposition a bouncing ball after it has passed through a surface
  88. How can I test whether points are within a polygon?
  89. How to calculate a direction vector for camera? (probably)
  90. Trajectory of a spinning ball
  91. How do I interpret the dot product of non-normalized vectors?
  92. How can I come up with a simple diminishing return equation?
  93. How can I come up with a simple diminishing return equation?
  94. How can I come up with a simple diminishing return equation?
  95. Formula to measure uv-mapping distortion (would benefit from align)
  96. Gravity: Slow down on ground approach
  97. Percentage of object inside a moving rect
  98. Percentage of object inside a moving rect
  99. 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)
  100. Implicit Functions and extracting an isosurface
  101. Explaining vector math for a pendulum camera
  102. Converting time of day into a smooth day/night variable?
  103. Screen coordinates to isometric coordinates? (maybe)
  104. How do I generate solar systems for a 2d universe map, but still look random
  105. RPG like hit points growth algorithms help
  106. RPG like hit points growth algorithms help
  107. Determining a sensible gear-like hierarchy for a series of connected objects
  108. How to use "weighted average easing" correctly with variable framerate?
  109. How do I convert from the global coordinate space to a local space?
  110. How do I convert from the global coordinate space to a local space?
  111. How can I find the tangent and normal at an interpolated point on a Catmull-Rom/Hermite spline?
  112. Predicted target location (real code, ought to be accompanied by MathJax)
  113. Using Bullet physics engine to find the moment of object contact before penetration
  114. How do I convert screen coordinates to between -1 and 1? (probably)
  115. Why do we use the Pythagorean theorem in game physics?
  116. How can I compare two quaternions for logical equality?
  117. How can I Intercept object with a circular motion
  118. Projecting a light onto a quad (apparent math pseudocode at the beginning is hard to understand)
  119. How can I rotate about an arbitrary point in 3D (instead of the origin)?
\$\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\$ – 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 .