trig approximations

Aug. 18th, 2017 07:33 am
mindstalk: (thoughtful)
[personal profile] mindstalk
One virtue of my math education was that it was fairly proof heavy; I feel I can demonstrate or prove most of what I know. I may have mentioned this not extending to sin(A+B), which I had to figure out later as an adult. It also didn't include detailed "how do we calculate this shit?" for stuff like trig, log, fractional exponents. Once you hit calculus the answer becomes "Taylor series or something better", but before then?

Feynman talks about it somewhat in Chapter 22 of his Lectures, which is a cool read; he goes from defining multiplication in terms of addition, to numerically suggesting Euler's law, and showing how to build up log tables along the way. It's a heady ride. But he doesn't talk about trig tables.

I've long had my own thoughts about those, and finally wrote some code to try out the calculations.

Basic idea is that given sin(a) = y/r, cos(a) = x/r, and the Pythagorean theorem, there are two right triangles for which we know the values precisely. The 45-45 is trivial, while the 30-60 one can be gotten from sin(60) = cos(30) = sin(30+30) = 2*sin(30)*cos(30). From there, you can apply the half-angle formula as often as you please, to get very small angles, at which point you'll notice that sin(x) ~= (approximately equal to) x for small x. Thus you can approximate an angle like 1 degree which you can't otherwise[1] get to, then use double and addition formulas to build back up to say 10 degrees or anything else.

The question in my mind always was, how good is that? And the code finally answers the question. Sticking to half-angle stuff is *very* accurate, matching the built-in function to 15 decimal places. Using a sin(1 degree) approximation and building up to sin(15 degrees) is accurate to 4 places; starting from 0.125 degrees instead is accurate to 6 places. I don't know how practically good that is; one part in a million sounds pretty good for pre-modern needs -- like, at that point can you make or measure anything that precisely? -- but Feynman says that Briggs in 1620 calculated log tables to 16 decimal places.

[ETA: hmm, I'd been assuming the built-in function, presumably based on power series, was the most accurate version, but maybe I should view it as deviating from the exact roots of the half-angle approach. Or both as having small errors from the 'true' value. Especially as Python's sin(30) returns 0.49999999999999994, not 0.5. Of course, both approaches are using floating point. sin(60) = sqrt(3)/2 to the last digit, but cos(30) is slightly different.]

[1] The two exact triangles basically give you pi/2 and pi/3, and those divided by 2 as much as you want. But you can't get to pi/5 exactly.
a/2 + b/3 = 1/5 #a and b integers
15a + 10b = 6
5(3a+2b) = 6
(note that 2a+3b=5 is totally solvable.)

Though I guess a more valid approach would be
c(1/2)^a + d/3*(1/2)^b = 1/5 #all variables integers
c*5*3*2^b + d*5*2^a = 3*2^(a+b)
5(c*3*2^b + d*2^a) = 3*2^(a+b)
which still isn't soluble.

Likewise for getting to pi/9 (20 degrees):
c(1/2)^a + d/3*(1/2)^b = 1/9
c*9*2^b + d*3*2^a = 2^(a+b)
3(c*3*2^b + d*2^a) = 2^(a+b)


Aug. 17th, 2017 05:48 pm
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll
Can maintain disdainful detachment even as another, unfamiliar, cat thoughtfully grooms Fig's hind paw.

Apropos of nothing

Aug. 16th, 2017 06:35 pm
aris_tgd: (shell beach)
[personal profile] aris_tgd
The random mer-people tail generator on may be my favorite sketch prompt generator all day.

Woe is me

Aug. 15th, 2017 05:14 pm
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll
Just noticed the book I was going to read tonight won't be out until November, so I shouldn't review it any time soon.

A note for next year

Aug. 13th, 2017 10:16 pm
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll
As near as I can tell from these rules James Nicoll Reviews does not qualify as a fanzine (it provides too much of my income). It might be a semi-prozine (bad for me, because my numbers would not get me onto the long list) or Related (where I also don't think I would made it onto the long list).
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll
There was talk of having a bonfire in October. Was trying to come up with theme/justification because I am incapable of spontaneity. Thought it might be nice to tie it in somehow to the Year of Waterloo Region SF. Wondered "what SF book features bonfires as a central image?"

Perseids Watch 2017: Success!

Aug. 13th, 2017 02:15 pm
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll
Many meteors seen, among other things.

Read more... )

More stuff I've seen

Aug. 12th, 2017 11:38 pm
aris_tgd: A black and white spiral on a Go board (Pi spiral)
[personal profile] aris_tgd
Well, I finally watched the first season of American Gods. I generally enjoyed it! I wasn't looking for a lot, honestly--I didn't love the book, it was fine. The whole thing is so blisteringly ignorant of Native American existence much less traditions that it's infuriating if I think about it too much. (But I guess that's par for the course for Gaiman, not to mention other UK authors writing about American subjects, hem, Rowling.) So aside from that major glaring issue, it was fun. The characters are great. Orlando Jones as Anansi was fan-fucking-tastic, I loved Shadow, and Salim, and I love the dynamic between Laura and Mad Sweeney even though I don't much care for either of them individually. And of course watching Ian McShane have fun is always great.

I didn't realize until I got closer to the ending that the show only covers the first part of the book, but I suppose that's par for the course.

I've also watched the first couple episodes of Brooklyn Nine-Nine, which I am also enjoying. It's still got more awkward/embarrassment based humor than I like what with that dude who's interested in Rosa, but everything else is terrific. I knew I was going to love Captain Holt and I do, I love him so much, I will put up with just about anything in a show if it means getting to watch him for seasons and seasons on end.

Also, the new DuckTales is awesome. That is all.
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll
(I think?), and since the year is half over, what YA do you expect to be nominated next year?

Lady Bloodfight

Aug. 11th, 2017 01:57 am
aris_tgd: Sinclair and Sakai, "Time for a moment." (Time for a moment)
[personal profile] aris_tgd
Seriously, what?

It's the version of Bloodsport where everyone's a lady, sure. But it's actually more than that, it's got a slightly more developed plot and some great characters.

I mean, the fight scenes aren't terrific, there are a few nice touches but they're not brilliant, and some of the line readings were just awful. But you know what? This was FUN, and the plot was fun enough that it was definitely worth my time. I think it might be worth yours.

I mean... it's Bloodsport, only there's also some backstory about two women who were in the kumite five years ago and tied and there's some kind of grudge, which we figure out about over the course of the movie. They're told they have to train their own apprentices to fight in the next kumite, and they each find out some more of that tragic backstory. It's cool, and there's neat stuff happening!

Look, it's like an hour and forty five minutes of ladies punching each other with some definite femslash feels going on there. I want everyone in the movie to make out with each other, even the scary Russian lady. It's on Netflix, check it out.

I kind of headcanon Jane as the daughter of Jean Claude Van Damme's character from Bloodsport and that reporter.

Fig and Ibid

Aug. 9th, 2017 08:33 pm
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll
Fig is content to wander around the large room he and his brother are in. Ibid is still hiding at the back of the top shelf (1) but came out for about an hour of combing. And attempted earbud eating.

Oddly, they don't seem to be eating their wet food (I did see both eat dry). I think it may be as simple as they are getting it in one bowl and don't know whose bowl it is supposed to be.

1: His host stacked bins so the cats can jump down without hurting themselves.
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll
Do reformed minions, mooks and goons have support groups?

Thank you!

Aug. 7th, 2017 03:16 pm
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll
To whoever bought me the subscription to Locus.

Bundle of Holding: BASH

Aug. 7th, 2017 02:45 pm
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll

Hero! Our fellowship of Basic Heroes bring you the BASH! Bundle, featuring the BASH! tabletop roleplaying game of fast and simple action from Basic Action Games. With BASH! (Basic Action Super Heroes), you can create characters and run four-color superheroic adventures within minutes. Easy to teach to novices and younger players, BASH! also works great for fantasy and space opera. The rulebooks and supplements in this bargain-priced collection give you everything you need for any kind of action-packed adventure.

More here.

Scalzi withdraws from Dragon Awards

Aug. 7th, 2017 02:42 pm
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll

The other day I announced The Collapsing Empire was a finalist for the Dragon Award in the Best Science Fiction novel category, which was neat. Today, I notified the Dragon Award administrators and let them know I was withdrawing The Collapsing Empire from consideration for the award.

More here

The thing which annoys me the most

Aug. 6th, 2017 11:33 pm
aris_tgd: "Tune your ear to the frequency of despair and cross-reference by the latitude and longitude of a heart in agony." (Lyttle Lytton Spider-Man Agony)
[personal profile] aris_tgd
... The grading that I have to do is annoying in many respects, but the worst is probably that there are mistakes my students make which they would be able to learn from if the "term" was more than four weeks long.

If this weren't summer, sure I'd have twice as many students to worry about and thus twice as many things to grade, but I'd also have more time to beat basic "how to write a thing" info into them.

Right now I just wince and try to figure out what to say upfront at the start of next term. Because I keep trying to emphasize what they need to know, and they keep missing it...

Fig and Ibid rehomed

Aug. 7th, 2017 12:15 am
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll
Somewhere where I can see them regularly. Ibid was still hiding in the back of a closet when I saw him today but Fig wanted to explore the house. At least he did until he found himself nose to nose with a calico. For reasons unclear, both Fig and Ibid showed up four years ago with a fear of calicoes. Then he realized another cat had quietly walked up behind him to check him out. Then he decided maybe the bedroom was better.

fanfic retrospective

Aug. 6th, 2017 08:49 pm
mindstalk: (Default)
[personal profile] mindstalk
I have no specific memory of when I first heard of the words fanfic, or fan fiction. There must have been a moment, after going to college, but no memory. (Filk I can do: S had tapes, and lent them to me, so that's restricted to a few years, and I can kind of remember borrowing and copying them.)

I can place a very likely upper bound. In the spring of 1998 I discovered "Buffy the Vampire Slayer" (there's a story there for another time), coming in with Surprise and Innocence as they aired, and after Becoming, plowing through jtr's videotapes. Some time after that I was on the Buffy mailing list, and was introduced to the Buffy-Xena crossover fanfic "When Hellmouths Collide" (a mere 870K words, which I never finished). I'd also found a trove of Post-Becoming fic, which I am tickled pink to see is still online.

I'd also had my own ficcy ideas, perhaps some Post-Becoming but mostly about Amy the Underused Witch; meanwhile, my friend Liz went and started writing her own Season 3 scripts, I think to the exclusion of watching the actual show.

I had been in online fandoms before then: the Babylon-5 newsgroup, where I coined "battlecrab" for the Shadow vessels; Deryni newsgroup or mailing list (where I helped with the FAQ), Pliocene newsgroup or mailing list; my own fan pages for Vernor Vinge and Steven Brust; adopting a fan page for Robin McKinley; a SF newsgroup in general... but not a blip or hint of memory of fanfic from any of those. Vs. the eruption of fanfic, named or otherwise, from Buffy.

Funnily enough, I grew up reading a fair bit of what I now consider to be essentially, if not legally, fanfic: tie-in novels. Lots of Star Trek novels, back when Paramount gave them a very loose leash and lots of ideas or varieties could be explored (also back when they were more written by women). Some Brian Daley Star Wars tie-ins. The "Jack McKinney" (pseudonym for Brian Daley and another writer) Robotech novels. In fact, despite watching some DS9 later, and bits of other series, "Star Trek" for me is largely the old TOS novels that I read as a child and teen, with mental visuals coming from the covers and whatever my imagination could spin from those.

As for fanfic after Buffy, I don't have a clear memory. I suspect it went into remission for some years, like my interest in (or even memory of) filk. I had my own unwritten ideas, particularly about Hodgell's stories, but I'm not sure when I re-engaged with ficcy fandoms again. Bujold list? IU Anime? I dunno.

Now, of course, it's a fairly decent part of the fiction I read, ranging from tiny drabbles to massive epics, from smut to deep explorations and extrapolations.

Chrono-trivia: is from 1998, AO3 from 2008. I remember Latin-Sarah talking about AO3 while I was at IU, but didn't realize it was that late.

Life, universe, everything

Aug. 6th, 2017 05:04 pm
aris_tgd: Player King, "We're actors! We're the opposite of people!" (Actors opposite of people)
[personal profile] aris_tgd
*eyes ficpositivity thread* Well, that's just depressing, then. Some days I don't know why I bother.

Part of my procrastinating this week has involved actually finishing some books. I've put some brief reviews up on goodreads. I very much enjoyed Lovecraft Country, but I feel like it was fairly obviously a book by a white person for a white audience--really just that it explained several things that for a black audience would not need to be explained, about the world that black people had to live in, in mid-century America and in many ways still today. But other than that, it was a good yarn.

Hundred Thousand Kingdoms was also great. I loved the way the mythology and the religion of the world worked, and was woven through the story. I have a bit of reservation/irritation about the way that sexual "deviance" gets used as a shorthand for evil (or as a way to round out evil) but this definitely isn't the most annoying I've seen recently...

Because then I fell down the hole of rereading the entire archive of Dominic Deegan, Oracle for Hire, the webcomic, after realizing that it ended a few years ago and I never read the end. It's very interesting to read now because there's been evolution of both the webcomic form and what's normal in terms of a cast of characters, and I feel like that's happened very recently in some ways. I mean, just looking at the difference between the Walkyverse and the DoAverse with the same author (Willis is rerunning It's Walky! with commentary, which makes the contrasts pretty tempting to draw.) So speaking of "Sexual deviation indicates evil," that sort of thing is all over DD, including some good old slut-shaming and a weird fascination with negging women with large breasts (okay, it only comes up three or four times, but as a woman with large breasts it annoyed me EVERY SINGLE TIME.)

Anyway, I don't really recommend doing that, but there were some cool visual things that he did with magic especially near the end, and the pacing was pretty good, and I got closure, yay.

Hunh, I wonder if Sluggy Freelance is still *checks* OMG SLUGGY FREELANCE IS STILL RUNNING.

*hem* I also started The Goblin Emperor, which is okay, but is kind of hard to follow right now.



August 2017


Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 19th, 2017 08:32 pm
Powered by Dreamwidth Studios