In the last week or two I've some time figuring out the next app I'm working on. In addition to finding code libraries and working out general application architecture, I also ended up spending a decent amount of time on the math.
It seems like there is always an interesting math problem. For the iRollDice app it was trying to figure out probability when you had a "drop lowest" modifier. It's pretty easy to figure the odds of rolling a "14" when you roll 4d6, but what are the odds of a "14" when you roll 5d6 and drop the lowest 2 rolls? Now calculate that on iPhone hardware... quickly... when rolling 99d100. Fun! Fun!
This time my math challenge was finding the angle created when connecting 3 points (A,B,C) in an X-Y coordinate plane. Oh, and the Y axis is inverted: y increases as you go down - the opposite of every textbook ever made. I think I have it all worked out now. It was humbling digging through the vocabulary again... radians, cosecant, inverse cosine, ray, dot-product. I wonder if Mr. Shilke, my high school math teacher, would be happy that I was able to figure this out? Or disappointed it was took some effort?
Anyhow, hope everyone had a good Turkey day!