Explorar o código

Updated vector turning math

The code example for how to turn a vector 90 degrees in either direction was wrong. The coordinates of the left vector were set to the "v_right" vector and vice-versa.
MugenHachi %!s(int64=8) %!d(string=hai) anos
pai
achega
86efdae7de
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      tutorials/vector_math.rst

+ 4 - 2
tutorials/vector_math.rst

@@ -166,10 +166,12 @@ Example:
 ::
 ::
 
 
     var v = Vector2(0,1)
     var v = Vector2(0,1)
+    
     # rotate right (clockwise)
     # rotate right (clockwise)
-    var v_right = Vector2(-v.y, v.x)
-    # rotate left (counter-clockwise)
     var v_right = Vector2(v.y, -v.x)
     var v_right = Vector2(v.y, -v.x)
+    
+    # rotate left (counter-clockwise)
+    var v_left = Vector2(-v.y, v.x)
 
 
 This is a handy trick that is often of use. It is impossible to do with
 This is a handy trick that is often of use. It is impossible to do with
 3D vectors, because there are an infinite amount of perpendicular
 3D vectors, because there are an infinite amount of perpendicular