20 Nov, 8 tweets, 1 min read
random memory: a calculus teacher screaming at the class that people who haven't memorized the value of sin & cos at common angles shouldn't be allowed to vote
pre-voting poll test:
1. what's the value of sin(1/8π)?
2. what's the value of cos(0.5π)?
please use at least three (3) decimal places
no degrees here. we use radians like real men.
degrees are for people who can't past 10 while wearing shoes.
The second one is a trick to catch out anyone using a computer as a calculator.
The first one is simple:
>>> math.sin(1/8*math.pi)
0.3826834323650898
but every school-aged child can tell you that the cosine of 90 degrees is, of course, zero.

But if you naively type "math.cos(0.5*math.pi)" into your local python3 interpreter, the result you get back is not 0. it's very close to zero, but not zero.
>>> math.cos(0.5*math.pi)
6.123233995736766e-17

floating point accuracy is a harsh mistress
naturally of course if you ask it to round it off to 3 digits it will just tell you "0.0", but it might throw you at first

• • •

Missing some Tweet in this thread? You can try to force a refresh

This Thread may be Removed Anytime!

Twitter may remove this content at anytime! Save it as PDF for later use!

# More from @Foone

22 Nov
BEFORE
AFTER!
The closeup of the horrible former condition.
21 Nov
Decommissioning Arecibo is a very sad move for science, but I understand why it needs to be done.
But people are already talking about what might replace it, and the various benefits of having it in different places... Have they considered placing it in space? Maybe at the earth-sun L2?
Obviously we can't name it like Arecibo and just call it by the local city, so maybe we could, I don't know, name it after an old deceased NASA administrator or something?
21 Nov
So there's a bay area (Cupertino) estate sale tomorrow, which has some interesting pictures.
And weirdly, it ties into something I posted a month ago.
It's the estate of Chuck Colby.
I posted about the Walkmac, a modification of a Macintosh to be portable, back in October, and remarked that it was odd that it said "from the estate of Chuck Colby" but I didn't see any mention of him being dead elesewhere.
but yeah, the estate sale has oscilloscopes and audio generators...
20 Nov
So remember that neat Twilight Zone trick I talked about a long while ago? I found a video that's using it for a different use, but in color.

I found it here, but the "source" that's reblogging is a memes page that seems to be focused around getting ad views and scam giveaways
this is that twilight zone effect I was talking about:
as for the top video, lemme know if you know where it's from.
also I wonder if it's being done in real time? it certainly looks like it is.
with a remote controlling red and blue lights you could certainly swap the colors very quickly
20 Nov
I've run into one of the (many) holes in my electronics knowledge and Google is not helping here, so:

I have a switch I want to use with a microcontroller. The switch has high resistance, though (a couple mega-ohms)
How do I detect the state of the switch?
Googling it either gives me solutions that are way overkill (like how to build a multimeter), not practical (academic abstracts about measuring super high resistance in the gigs-ohm range), or anti-answers (get a different switch, one that doesn't suck)
I seem to vaguely get that there's some trick where you set up a matching(ish) resistance and the switch changing state causes the current flow to switch direction, enough to be detectable?
20 Nov
I'm always vaguely amused by seeing those industrial trucks drive by with this "warning sign".

WARNING: THE STUFF THIS TRUCK IS CARRYING CANNOT BE SET ON FIRE, EVEN IN AN EMERGENCY.
Although I swear the one I just saw only said "non flammable" and didn't specify gas.
And I thought: wait, doesn't that apply to most trucks, then? Why don't they have warning signs?
But clearly some trucks DO have flammable stuff on them. Like, I saw a truck for a shredding company, it's gonna be full of paper, right? That'll burn quite well.
There's no warning for flammability there!