![]() |
Quote:
|
Quote:
I wish our calculators were as easy to program with as PHP, it would have made math class so much easier... |
I'm using:
$FA = sqrt(rad2deg(atan($MFh/2))); and getting '3.56' as the answer when $MFh is set to .45. I should be getting "36 degrees". I think the decimal place may be off? |
My other equation isn't working right either...
I have the two variables, and depending on which one the user gives, it should solve for the other. but it seems that the answers don't work the other way: for example if I set $FA and get an answer for $MFh, then use that answer to solve for $FA again, the answer i get isn't the number I started with. the two equations are: PHP Code:
PHP Code:
|
I guess this has gone from a general math question, to a PHP syntax issue. Should it be moved to a different forum?
|
AFAIK, in php both TAN and ATAN work in radians, so using rad2deg will screw up the answer.
|
Quote:
What should it be then? if $MF needs to be a decimal, and $FA is in degrees? |
All times are GMT. The time now is 02:04 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|