From 716f48c6ee03bc05c1df95112c7c8f83fa894d3a Mon Sep 17 00:00:00 2001 From: MugenHachi Date: Thu, 17 Nov 2016 09:55:10 -0200 Subject: [PATCH] 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. (cherry picked from commit 86efdae7de6aa57a63f43b0d1d8fcebd69b4a8e3) --- tutorials/vector_math.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tutorials/vector_math.rst b/tutorials/vector_math.rst index d88fcdd2..cb9dc679 100644 --- a/tutorials/vector_math.rst +++ b/tutorials/vector_math.rst @@ -166,10 +166,12 @@ Example: :: var v = Vector2(0,1) + # rotate right (clockwise) - var v_right = Vector2(-v.y, v.x) - # rotate left (counter-clockwise) 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 3D vectors, because there are an infinite amount of perpendicular