Trying to figure out how the hell to code up a Java program that uses f(x) = x^k - n to calculate the kth root of a real number n by taking a guess x0 and improving that guess by performing iter steps of this
took me SO LONG because I had no idea what a derivative was (hooray for COM!). However, after I spent several hours learning basic calculus, the stupid method that does the calculation took me ten minutes to write. It works, but it seems so ridiculously simple that I'm afraid I did something wrong.
public static float approximate(int k, float n, float x0, int iter){
if(iter == 0 || Math.pow(x0, k) - n == 0){
return x0;
} else{
x0 = (float)(x0 - ((Math.pow(x0, k) - n)/(k * (Math.pow(x0, (k-1))))));
return approximate(k, n, x0, iter - 1);
}
}
Last night, I was going over my photojo syllabus and thinking of ideas for the different assignments, when I realized that it would be awesome to shoot Anime Boston for my big photo essay. It's extremely interesting visually, thousands of people will be there, and it'd be just plain FUN to cover. I could take pictures of the dealers' room, the huge masquerade line and the masquerade itself, the herds of cosplayers that invade the food court and the confused shoppers that gawk at them, and tons of other crazy stuff. Now I just need my professor to approve my idea, and I see no reason for him not to. I'm so excited about this it's not even funny. :D
I'm also thinking about possibly getting involved with
Exposure Initiative ; it seems like a good program, though I'm not exactly a great teacher. I think I'll at least go to the meeting tomorrow and see what it's like.