math formula problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
deras
Forum Newbie
Posts: 24
Joined: Sun Nov 02, 2003 10:26 am

math formula problem

Post by deras »

i fixed the problem... thanks.
Last edited by deras on Sun Nov 23, 2003 4:00 am, edited 1 time in total.
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post by Johnm »

First thing you need to do is straighten this out:
$distance=sqrt($level1*$level1+$level2*$level2-2*$level1*$level2*cos($enclosed_radians));
for example:
(2 * 2 + 3 * 3 - 2 * 2 * 3 ) = 114 is not the same as
(((2 * 2) + ((3 * 3) - 2)) * (2 * 3)) = 66 is not the same as
(((2 * 2) + 3) * (3 - 2) * (2 * 3)) = 42 and so on...


John M
Post Reply