Remix.run Logo
direwolf20 3 hours ago

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.

creata 3 hours ago | parent [-]

> 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.

direwolf20 an hour ago | parent [-]

Why use a unit complex number (2 numbers) instead of an angle (1 number)? Maybe it optimizes out the sins and cosses better — I don't know — but a cache is not a new type of number.