[Editorial Note: Here is Mike's solution which relies on a computerprogram to find the optimal answer. Can anyone give a purely mathematicalsolution?]
Here's the program:
#include#include #include #include double pi = 3.1415926535;void main() { double a,b,c, maxVal = 0.0, value; while (!kbhit()) { do { a = 90.0*rand()/RAND_MAX; b = (90-a)*rand()/RAND_MAX + a; c = 180.0-a-b; } while (a > b || b > c || c > 90.0); value = sin(a*2*pi/360.0)*tan(b*2*pi/360.0)*cos(c*2*pi/360.0); if (value > maxVal) { maxVal = value; printf("a = %.3f, b = %.3f, c = %.3f, value = %.3f\n",a,b,c,value); } }}
Back to the Math home page