Write this in Java: (Geography: estimate areas) Use the GPS locations for Atlanta, Georgia; Orlando, Florida; Savannah, Georgia; and Charlotte, North Carolina in the figure in Section 4.1 to compute the estimated area enclosed by these four cities. Orlando (28.5383355, -81.3792365) Atlanta (33.7489954, -84.3879824) Savannah (32.0835407, -81.0998342) Charlotte (35.2270869, -80.8431267)
Write this in Java: (Geography: estimate areas) Use the GPS locations for Atlanta, Georgia;
Orlando, Florida; Savannah, Georgia; and Charlotte, North Carolina in the figure in Section 4.1 to compute the estimated area enclosed by these four cities.
Orlando (28.5383355, -81.3792365)
Atlanta (33.7489954, -84.3879824)
Savannah (32.0835407, -81.0998342)
Charlotte (35.2270869, -80.8431267)
(Hint: Use the formula in
between two cities. d = radius * arccos(sin (x1) * sin(x2) + cos(x1) * cos(x2) * cos(y1 - y2)) . Divide the polygon into two triangles and use the formula in
Programming Exercise 2.19 to compute the area of a triangle.)
s = (side1 + side2 + side3)/2;
area = sqrt(s(s - side1)(s - side2)(s - side3))
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images