MCPcopy
hub / github.com/golang/geo / ExampleAreaFromSteradians

Function ExampleAreaFromSteradians

earth/earth_example_test.go:58–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56}
57
58func ExampleAreaFromSteradians() {
59 bermuda := s2.PointFromLatLng(s2.LatLngFromDegrees(32.361457, -64.663495))
60 culebra := s2.PointFromLatLng(s2.LatLngFromDegrees(18.311199, -65.300765))
61 miami := s2.PointFromLatLng(s2.LatLngFromDegrees(25.802018, -80.269892))
62 triangle := s2.PolygonFromLoops(
63 []*s2.Loop{s2.LoopFromPoints([]s2.Point{bermuda, miami, culebra})})
64 area := earth.AreaFromSteradians(triangle.Area())
65 fmt.Printf("Bermuda Triangle is %.2f square miles", area.SquareMiles())
66 // Output: Bermuda Triangle is 464541.15 square miles
67}
68
69func ExampleSteradiansFromArea() {
70 steradians := earth.SteradiansFromArea(unit.SquareCentimeter)

Callers

nothing calls this directly

Calls 6

PointFromLatLngFunction · 0.92
LatLngFromDegreesFunction · 0.92
PolygonFromLoopsFunction · 0.92
LoopFromPointsFunction · 0.92
AreaFromSteradiansFunction · 0.92
AreaMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…