Browse Source

Fixed cross product formula

Components should be multiplied when calculating the cross product, not added.
Aidan Mueller 8 years ago
parent
commit
dccd2ac732
1 changed files with 3 additions and 3 deletions
  1. 3 3
      tutorials/vector_math.rst

+ 3 - 3
tutorials/vector_math.rst

@@ -674,9 +674,9 @@ The formula for the cross product is:
 ::
 
     var c = Vector3()
-    c.x = (a.y + b.z) - (a.z + b.y)
-    c.y = (a.z + b.x) - (a.x + b.z)
-    c.z = (a.x + b.y) - (a.y + b.x)
+    c.x = (a.y * b.z) - (a.z * b.y)
+    c.y = (a.z * b.x) - (a.x * b.z)
+    c.z = (a.x * b.y) - (a.y * b.x)
 
 This can be simplified, in Godot, to: