5 ms·
> But math never decreed that sine and cosine have to take radian arguments! That is not entirely true. It comes from the relationship between those functions
by kazinator 4y ago
> But math never decreed that sine and cosine have to take radian arguments!
That is not entirely true. It comes from the relationship between those functions and the complex numbers via the Euler formula.
ix
e = cos x + i sin x
There may be arithmetic/numerical inconveniences, but that's not all there is to "math".
Let's define ncos and nsin ("nice cos, nice sin") as follows:
nsin x = sin 2πx
ncos x = cos 2πx
So then what do we make of:
ncos x + i nsin x
This has to be
cos 2πx + i sin 2πx
which is then
2πix ( 2π) ix ix
e = ( e ) = f
2π
Where f = e is a weird number like 535.4916. This f doesn't have nice properties. E.g.:
d x x
- f /= f
dx
Otherwise it works; for instance 90 degrees is 0.25 and surely enough
0.25i
f = i
In situations not involving e in relation to angular representations via Euler, f cannot replace e.
I'm all for having parallel trig functions in libraries that work with turns, though.
The annoying 2π factor shows up in lots of places though. Should way, say, in electronics, redefine a new version of capacitive reactance which doesn't have 2πf in the denominator, but only f?
- jVinc 4y agoI see where you're coming from, if the formulas end up having weird numbers like 535.4916 or numbers like 2.718 or 6.28318 then obviously there's something suspicious about the equation. But small correction though. You got the number wrong, it's actually much more weird than any of those mentioned. The actual equation you come to for ncos an nsin is: (-1)^(2x) = ncos(x) + i nsin(x) And yes, -1 is a very weird number. If you take it to the power of something divisible by 2 you get itself raised to zero. What's up with this spooky periodicity? Also if you have x=1/4, then we get weird numbers like sqrt(-1) what on earth is that all about? No way that will fly, no way. No I'll take my 2.718^((-1)^(1/2)) and multiply through with 6.28318 that way I don't have to bother understanding what I'm doing I can sleep comfortable at night knowing that someone else has done all the thinking that needs to be done on the matter, and that turns or rotations are a blasphemous concept that breaks the very concept of math through scaling of an axis. You'd think math was strong enough to withstand such a minor change, but the textbooks do not mention it thus it must not be contemplated!
- justinpombrio 4y agoThis is a very good point, but it took me a minute to get what you were saying beneath the snark. Translating without the snark: There's a famous equation relating sin and cos to complex exponentiation. It also helps explain the Taylor expansions of sin and cos, which is one way to compute them and to find properties about them. It's a very important equation. It is: ix e = cos x + i sin x kazinator's point was that this equation relies on cos and sin taking radians as arguments. If they take turns instead, then you need to insert messy extra constants to state this equation! jVinc's counter-point, made with lots of snark, is that there's an equation that's even nicer if you just instead measure angles in turns with ncos and nsin: (-1)^(2x) = ncos(x) + i nsin(x) It's similar, but doesn't require the magic constant e. A proof sketch that these are equivalent: (-1)^(2x) = e^ln((-1)^(2x)) = -e^(2x) = e^(i * (2 pi x)) using e^(pi i) = -1
- deleted 4y ago[deleted]
- thrtythreeforty 4y agoWow, this version makes intuitive sense when retroactively applying what I already know about the complex plane, and rotations about it. Thank you!
- areyousure 4y agoPerhaps an even nicer equation: 1^x = ncos(x) + i nsin(x) using a multi-valued definition of the exponentiation on the left hand side.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- 2muchcoffeeman 4y agoIsn’t this just changing units to suit your purpose? Same way we might use electron volts rather than volts to make the equations nice.
- rocqua 4y agoThis makes a lot of sense when you are expecting to take derivatives, integrals, or use complex numbers. In cases outside of that, radians lose their advantage over turns.
- kragen 4y agoIf you're not using derivatives, integrals, or complex numbers, maybe you'd be better off using Wildberger's "rational trigonometry" with quadrances and spreads instead of angles? I haven't actually tried it myself. Wildberger's motivation is a sort of ultra-strict Platonism* mixed with the desire to extend analytic geometry to fields other than the real numbers, though, so it wouldn't be surprising if it wasn't actually a simpler way to write Asteroids. Doing trigonometry in Galois fields sounds super cool though and I hope I understand it one day. Alternatively you can just directly represent angles as unit vectors in the desired direction, which is pretty much the same as using complex numbers. Angle addition is complex multiplication, angle bisection is complex square root, and computing the sine and cosine is simplicity itself. (This takes twice as much space. If you choose to store only the real part of the complex number, you can only represent angles up to half a turn, same as in Wildberger's approach, you lose some precision near the limits, and the other operations require some extra computations.) I have tried this, for example in http://canonical.org/~kragen/sw/aspmisc/my-very-first-raytracer http://canonical.org/~kragen/sw/aspmisc/my-very-first-raytra... and https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/sdf.lua https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/sdf.lu..., and in the cases I've tried it, it works great. I'm interested to hear other people's experiences on this count! ______ * His main concern is that irrational numbers don't, in some sense, really exist, so they're a bad basis for trigonometry. As I understand it, not only is Platonism now a minority among foundations-of-mathematics types, but even Platonists generally believe that irrational numbers are just as real as rational ones, so as I understand it, Wildberger's viewpoint is held by quite a small minority. That doesn't, of course, imply anything about whether it's correct.
- kazinator 4y agoSo if I wanted to, say, calculate the height of a pole from the length of its shadow, I should use Wildberger's rational trig, because I don't need derivatives, integrals, or complex numbers? :)
- andrewflnr 4y agoIt's simpler than that. Draw a circle of radius 1, and draw two lines through the center. The distance along the circumference between those lines is the angle between them in radians. If you really want to remove the multiplicative identity as a magic number, you can define the radian angle as the ratio of the subtended circumference over the radius. IMO this is at least the most accessible argument for why radians are special, and while I don't pretend to understand complex exponentiation, I expect it's the root of why other math involving radians turns out nicely.