Add math/formula support in Sphinx

This commit is contained in:
Chris Bradfield 2017-12-02 09:15:01 -08:00
parent 5cd6f48767
commit 59eebac905
2 changed files with 8 additions and 5 deletions

View File

@ -11,7 +11,7 @@ needs_sphinx = '1.3'
# Sphinx extension module names and templates location
sys.path.append(os.path.abspath('extensions'))
extensions = ['gdscript', 'sphinx_tabs.tabs']
extensions = ['gdscript', 'sphinx_tabs.tabs', 'sphinx.ext.imgmath']
templates_path = ['_templates']
# You can specify multiple suffix as a list of string: ['.rst', '.md']

View File

@ -212,14 +212,17 @@ but is often misunderstood. Dot product is an operation on two vectors that
returns a **scalar**. Unlike a vector, which contains both magnitude and
direction, a scalar value has only magnitude.
The formula for dot product takes two common
forms:
The formula for dot product takes two common forms:
.. image:: img/vector_dot1.png
.. math::
A \cdot B = \left \| A \right \|\left \| B \right \|\cos \Theta
and
.. image:: img/vector_dot2.png
.. math::
A \cdot B = A_{x}B_{x} + A_{y}B_{y}
However, in most cases it is easiest to use the built-in method. Note that
the order of the two vectors does not matter: