![]() The real component of the complex number is the X axis and the imaginary component is the Y axis.Īs you can see we rotated the purple vector (0,1) which has an angle of 90 degrees and length of 1, by the blue vector (1,1) which has an angle of 45 degrees and a length of sqrt(2), and as a result we got the tan vector (-1,1) which has an angle of 135 degrees and a length of sqrt(2). In the above we change i – 1 to -1 + i to make the next step easier. That’s a mouth full, so here it is, step by step. To do that, we just convert the vectors to complex numbers, using the x axis as the real number component, and the y axis as the imaginary number component, then multiply them, and convert back to vectors. Let’s say that we want to rotate the vector (0,1) by the angle of the vector (1,1). There we go, that’s all there is to multiplying complex numbers together! Getting Down To Business: Rotating Using that, we can multiply and then combine term, remembering that i^2 is -1: if you remember that from high school math class, it stands for First, Outer, Inner, Last. Luckily, multiplying complex numbers together is as simple as using F.O.I.L. We’ll need to be able to multiply complex numbers together to do our rotations. You can combine a real and imaginary number into something called a complex number like this: 3 + 5i Quick Review: Multiplying Complex Numbers The square root of -25 is 5*i, or just 5i, which means “5 times the square root of -1”. Without using i, you can’t take the square root of a negative number because if the answer is negative, multiplying a negative by a negative is positive, and if the answer is a positive, multiplying a positive by a positive is still a positive.īut, using i, you CAN take the square root of negative numbers. The imaginary number “i” is the square root of -1. This technique is so simple that you can even use it to rotate vectors by hand on paper! Quick Review: Imaginary and Complex Numbers In this post I share a technique that lets you use imaginary numbers (complex numbers more specifically) to be able to rotate vectors in 2d. There’s nothing I like more than seeing something common used in an uncommon way to do something that I didn’t know was possible. I’m a big fan of “exotic” math and programming techniques.
0 Comments
Leave a Reply. |