# ABOUT CALCULATION - Biorhythms

• 05-20-2006
peter_hii
ABOUT CALCULATION - Biorhythms
HI EVERYONE,,

this is my function and i will state the problem at the bottom..

Code:

//calculate the physical cycle which has physical curve 23 days
double physicalCycle(Date& dob, Date& currentDate)
{
double score;
double distance = distanceFromDobAndCurrentDate(dob, currentDate);

score = 100 * sin(360*(distance/23));
return score;
//check - the answer should be 63.10879473
}

when i entered
dob: 1 1 1969
current date: 1 6 2004

the output of the physical cycle should be 63.10879473 but it is wrongly output which is -80.---

can someone tell me wat is the problem, is it the formula or..?

this is the website u can calculate the physical cycle http://www.orcapia.com/froggy/biorhy...&detl=1&save=1
• 05-20-2006
JaWiB
Have you checked that the distance is calculated correctly? Have you taken into account that sin takes radians, not degrees? (To convert from degrees to radians multiply by pi and divide by 180)
• 05-21-2006
peter_hii
i though tat sin is in the library..
• 05-21-2006
peter_hii
yes the distance is 100% sure correct