MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / unit_circle_righthalf

Method unit_circle_righthalf

lib/matplotlib/path.py:930–969  ·  view source on GitHub ↗

Return a `Path` of the right half of a unit circle. See `Path.circle` for the reference on the approximation used.

(cls)

Source from the content-addressed store, hash-verified

928
929 @classmethod
930 def unit_circle_righthalf(cls):
931 """
932 Return a `Path` of the right half of a unit circle.
933
934 See `Path.circle` for the reference on the approximation used.
935 """
936 if cls._unit_circle_righthalf is None:
937 MAGIC = 0.2652031
938 SQRTHALF = np.sqrt(0.5)
939 MAGIC45 = SQRTHALF * MAGIC
940
941 vertices = np.array(
942 [[0.0, -1.0],
943
944 [MAGIC, -1.0],
945 [SQRTHALF-MAGIC45, -SQRTHALF-MAGIC45],
946 [SQRTHALF, -SQRTHALF],
947
948 [SQRTHALF+MAGIC45, -SQRTHALF+MAGIC45],
949 [1.0, -MAGIC],
950 [1.0, 0.0],
951
952 [1.0, MAGIC],
953 [SQRTHALF+MAGIC45, SQRTHALF-MAGIC45],
954 [SQRTHALF, SQRTHALF],
955
956 [SQRTHALF-MAGIC45, SQRTHALF+MAGIC45],
957 [MAGIC, 1.0],
958 [0.0, 1.0],
959
960 [0.0, -1.0]],
961
962 float)
963
964 codes = np.full(14, cls.CURVE4, dtype=cls.code_type)
965 codes[0] = cls.MOVETO
966 codes[-1] = cls.CLOSEPOLY
967
968 cls._unit_circle_righthalf = cls(vertices, codes, readonly=True)
969 return cls._unit_circle_righthalf
970
971 @classmethod
972 def arc(cls, theta1, theta2, n=None, is_wedge=False):

Callers 1

_set_circleMethod · 0.80

Calls 1

sqrtMethod · 0.80

Tested by

no test coverage detected