>I am writing a small finacial calculator. I know how to calculate a

>payment:

>payment = (amount * pow(1 + interval_rate, interval * periods)) /

>((1+interval_rate) * ((pow(1+intrval_rate, intervals * periods)

>-1)/interval_rate)

>or at least something like that. Anyway, I have checked it against Excel

>and Applix and there payment functions seem to agree.

>What I need to calculate interest vs principal for specific payments. I

>know it is easy, I just can't remember it, and can't find any books

>right Now, if anyone knows off the top of their head, drop me a an

>e-mail.

>--

>Mohawk Software

>Windows 95, Windows NT, UNIX, Linux. Applications, drivers, support.

>Take the Mohawk Software Computer Survey at: www.mohawksoft.com

Well, I have a BA in Math, does that count? :-)

Admittedly, computing the interest given a payment P, number of payments n,

and principal A(0) might be a bit tricky.

If I define A(n) as the principal left after n payments,

then A(0) is the original amount of the loan, A(1) = A(0)*(1+r) - P,

A(2) = A(1)*(1+r) - P, and so on, where P is of course the payment

and r is the rate, expressed as a fraction (.05 = 5%, for example).

At this point, r is unknown.

Now, A(n)=A(0)*(1+r)**n - P*(1+r)**(n-1) - P*(1+r)**(n-2) ... - P*(1+r) - P

= A(0)*(1+r)**n - P*(((1+r)**n-1) / r).

Now we get to solve for r. Good luck, although it's helped a bit

by noting that A(n) = 0 (we assume the loan is paid off), so

0 = A(0)*(1+r)**n - P*((1+r)**n-1) / r.

But it's a mess no matter how one relates to it.

----