← Back to context

Comment by direwolf20

8 days ago

Rotations fell out of the structure of complex numbers. They weren't placed there on purpose. If you want to rotate things there are usually better ways.

> If you want to rotate things there are usually better ways.

Can you elaborate? If you want a representation of 2D rotations for pen-and-paper or computer calculations, unit complex numbers are to my knowledge the most common and convenient one.

  • For pen and paper you can hold tracing paper at an angle. Use a protractor to measure the angle. That's easier than any calculation. Or get a transparent coordinate grid, literally rotate the coordinate system and read off your new coordinates.

    For computers, you could use a complex number since it's effectively a cache of sin(a) and cos(a), but you often want general affine transformations and not just rotations, so you use a matrix instead.

    • > For computers, you could use a complex number since it's effectively a cache of sin(a) and cos(a), but you often want general affine transformations and not just rotations, so you use a matrix instead.

      That makes sense in some contexts but in, say, 2D physics simulations, you don't want general homogeneous matrices or affine transformations to represent the position/orientation of a rigid body, because you want to be able to easily update it over time without breaking the orthogonality constraint.

      I guess you could say that your tuple (c, s) is a matrix [ c -s ; s c ] instead of a complex number c + si, or that it's some abstract element of SO(2), or indeed that it's "a cache of sin(a) and cos(a)", but it's simplest to just say it's a unit complex number.

      5 replies →

No.

The whole idea of imaginary number is its basically an extension of negative numbers in concept. When you have a negative number, you essentially have scaling + attribute which defines direction. When you encounter two negative attributes and multiply them, you get a positive number, which is a rotation by 180 degrees. Imaginary numbers extend this concept to continuous rotation that is not limited to 180 degrees.

With just i, you get rotations in the x/y plane. When you multiply by 1i you get 90 degree rotation to 1i. Multiply by i again, you get another 90 degree rotation to -1 . And so on. You can do this in xyz with i and j, and you can do this in 4dimentions with i j and k, like quaternions do, using the extra dimension to get rid of gimbal lock computation for vehicle control (where pointed straight up, yaw and roll are identicall)

The fact that i maps to sqrt of -1 is basically just part of this definition - you are using multiplication to express rotations, so when you ask what is the sqrt of -1 you are asking which 2 identical number create a rotation of 180 degrees, and the answer is 1i and 1i.

Note that the definition also very much assumes that you are only using i, i.e analogous to having the x/y plane. If you are working within x y z plane and have i and j, to get to -1 you can rotate through x/y plane or x/z plane. So sqrt of -1 can either mean "sqrt for i" or "sqrt for j" and the answer would be either i or j, both would be valid. So you pretty much have to specify the rotation aspect when you ask for a square root.

Note also that you can you can define i to be <90 degree rotation, like say 60 degrees and everything would still be consistent. In which case cube root of -1 would be i, but square root of -1 would not be i, it would be a complex number with real and imaginary parts.

The thing to understand about math is under the hood, its pretty much objects and operations. A lot of times you will have conflicts where doing an operation on a particular object is undefined - for example there are functions that assymptotically approach zero but are never equal to it. So instead, you have to form other rules or append other systems to existing systems, which all just means you start with a definition. Anything that arises from that definition is not a universal truth of the world, but simply tools that help you deal with the inconsistencies.

  • The whole idea of an imaginary number is that it squares to a negative number. Everything else is accidental. Nobody expected that exp(i*a)=cos(a)+i*sin(a). Totally wacky discovery.

    Imaginary numbers don't work in 3D, by the way. The most natural representation of a 3D rotation is a normalized 4D quaternion, and it's still pretty weird.

  • Nope. (Just to imitate your style)

    There's more to it than rotation by 180 degrees. More pedagogically ...

    Define a tuple (a,b) and define addition as pointwise addition. (a, b) + (c, d) = (a+c, b+d). Apples to apples, oranges to oranges. Fair enough.

    How shall I define multiplication, so that multiplication so defined is a group by itself and interacts with the addition defined earlier in a distributive way. Just the way addition and multiplication behave for reals.

    Ah! I have to define it this way. OK that's interesting.

    But wait, then the algebra works out as if (0, 1) * (0, 1) = (-1, 0) but right hand side is isomorphic to -1. The (x, 0)s behave with each other just the way the real numbers behave with each other.

    All this writing of tuples is cumbersome, so let me write (0,1) as i.

    Addition looks like the all too familiar vector addition. What does this multiplication look like? Let me plot in the coordinate axes.

    Ah! It's just scaled rotation, These numbers are just the 2x2 scaled rotation matrices that are parameterized not by 4 real numbers but just by two. One controls degree of rotation the other the amount of scaling.

    If I multiply two such matrices together I get back a scaled rotation matrix. OK, understandable and expected, rotation composed is a rotation after all. But if I add two of them I get back another scaled rotation matrix, wow neato!

    Because there are really only two independent parameters one isomorphic to the reals, let's call the other one "imaginary" and the tupled one "complex".

    What if I negate the i in a tuple? Oh! it's reflection along the x axis. I got translation, rotation and reflection using these tuples.

    What more can I do? I can surely do polynomials because I can add and multiply. Can I do calculus by falling back to Taylor expansions ? Hmm let me define a metric and see ...

    • I think we are agreeing.

      You made it seem like rotations are an emergent property of complex numbers, where the original definition relies on defining the sqrt of -1.

      Im saying that the origin of complex numbers is the ability to do arbitrary rotations and scaling through multiplication, and that i being the sqrt of -1 is the emergent property.

      13 replies →