Browse Source

Add math/formula support in Sphinx

Chris Bradfield 7 năm trước cách đây
mục cha
commit
59eebac905
2 tập tin đã thay đổi với 8 bổ sung5 xóa
  1. 1 1
      conf.py
  2. 7 4
      learning/features/math/vector_math.rst

+ 1 - 1
conf.py

@@ -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']

+ 7 - 4
learning/features/math/vector_math.rst

@@ -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: