MCPcopy
hub / github.com/ManimCommunity/manim / get_critical_point

Method get_critical_point

manim/mobject/mobject.py:2203–2228  ·  view source on GitHub ↗

Picture a box bounding the :class:`~.Mobject`. Such a box has 9 'critical points': 4 corners, 4 edge center, the center. This returns one of them, along the given direction. :: sample = Arc(start_angle=PI / 7, angle=PI / 5) # These are all equivale

(self, direction: Vector3DLike)

Source from the content-addressed store, hash-verified

2201 return np.max(values)
2202
2203 def get_critical_point(self, direction: Vector3DLike) -> Point3D:
2204 """Picture a box bounding the :class:`~.Mobject`. Such a box has
2205 9 'critical points': 4 corners, 4 edge center, the
2206 center. This returns one of them, along the given direction.
2207
2208 ::
2209
2210 sample = Arc(start_angle=PI / 7, angle=PI / 5)
2211
2212 # These are all equivalent
2213 max_y_1 = sample.get_top()[1]
2214 max_y_2 = sample.get_critical_point(UP)[1]
2215 max_y_3 = sample.get_extremum_along_dim(dim=1, key=1)
2216
2217 """
2218 result = np.zeros(self.dim)
2219 all_points = self.get_points_defining_boundary()
2220 if len(all_points) == 0:
2221 return result
2222 for dim in range(self.dim):
2223 result[dim] = self.get_extremum_along_dim(
2224 all_points,
2225 dim=dim,
2226 key=direction[dim],
2227 )
2228 return result
2229
2230 # Pseudonyms for more general get_critical_point method
2231

Callers 10

align_on_borderMethod · 0.95
move_toMethod · 0.95
get_edge_centerMethod · 0.95
get_cornerMethod · 0.95
get_centerMethod · 0.95
_get_bounding_boxMethod · 0.80
next_toMethod · 0.80
align_toMethod · 0.80
__init__Method · 0.80

Calls 2

Tested by

no test coverage detected