A farmer wishes to enclose the maximum possible area with 100 meters of fence. The pasture is bordered by a straight cliff, which may be used as part of the fence. What is the maximum area that can be enclosed?
[*] this post was modified to correct formatting problems in the formulas and correct the Basic program to use radians for the SIN() function...
Area of a segment is given as:
Area = 1/2•R^2•(PI/180•THETASin(THETA) in degrees
arc length is given as:
Arc Length = (THETA•PI)/180•R in degrees
100 = (THETA•PI•R)/180
18000 = THETA•PI•R
r = 18000/(THETA•PI)
If I plug 18000/(THETA•PI) back intot he original formula for the area of a segment in place of R I get:
Area = 1/2•(18000/(THETA•PI))^2•(PI/180•THETASin(THETA) < assuming that SIN() uses degrees...
I then use the following program to check each degree from 1 to 180 to see which gives the maximum area for the segment:
Dim I, Degrees As Integer
Dim Area, TopArea, Pi As Double
Pi = 3.1415926
Degrees = 0
TopArea = 0
For I = 1 To 180
Area = (1 / 2) * (18000 / (I * Pi)) ^ 2 * (Pi / 180 * I  Sin(Pi * I / 180))
If Area > TopArea Then
TopArea = Area
Degrees = I
End If
Next
Text1.Text = Degrees
Text2.Text = TopArea
This gives me the maximum area of 848006 m² and a value of degrees of 4. [*]
What did I do wrong? Did I forget to convert between degrees and radians somewhere?[*]
[*] The corrected program returns a value of 180° for Theta and a total area for the segment as 1591.5494...
Edited on June 18, 2004, 1:14 pm
Edited on June 18, 2004, 1:34 pm

Posted by Erik O.
on 20040618 10:51:31 