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

Function CapFromCenterHeight

s2/cap.go:88–90  ·  view source on GitHub ↗

CapFromCenterHeight constructs a cap with the given center and height. A negative height yields an empty cap; a height of 2 or more yields a full cap. The center should be unit length.

(center Point, height float64)

Source from the content-addressed store, hash-verified

86// negative height yields an empty cap; a height of 2 or more yields a full cap.
87// The center should be unit length.
88func CapFromCenterHeight(center Point, height float64) Cap {
89 return CapFromCenterChordAngle(center, s1.ChordAngleFromSquaredLength(2*height))
90}
91
92// CapFromCenterArea constructs a cap with the given center and surface area.
93// Note that the area can also be interpreted as the solid angle subtended by the

Callers 8

TestEncodeDecodeFunction · 0.85
cap_test.goFile · 0.85
TestCapContainsFunction · 0.85
TestCapCentroidFunction · 0.85
TestCapUnionFunction · 0.85
TestRectCapBoundFunction · 0.85
TestCellUnionExpandFunction · 0.85

Calls 2

CapFromCenterChordAngleFunction · 0.85

Tested by 7

TestEncodeDecodeFunction · 0.68
TestCapContainsFunction · 0.68
TestCapCentroidFunction · 0.68
TestCapUnionFunction · 0.68
TestRectCapBoundFunction · 0.68
TestCellUnionExpandFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…