Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick

Mathematica? I wish.

I feel so dirty. (I'll explain in a second)

I don't own or know how to use any high-end mathematics software. I once had R skillz, but they've been fading over the past year or so.

So, when it came time to find the average value of the function sin(wt)cos(wt+pi/8), what do I do?

use constant PI => 3.14159;
use constant PHI => PI / 8;
for ($t=0; $t<PI*20; $t+=0.01) {
  $val = sin($t)*cos($t+PHI);
  $points++; $sum += $val;
printf "avg = %.4f\n", ($sum/$points);
I got the answer correct (and 3 other similiar problems), but this is totally the wrong way to do it.

I really wish I were good at math ... I used to be a lot better, but I'm forgetting so much. There are so many things I wish I were good at, but it's a matter of time.

I want to learn German more. I bought a whole pack of "learn German" CD-ROMs .... I should spend more time working with those.


Tags: lang
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.