manim.mobject.geometry.Arrow

class Arrow(*args, stroke_width=6, buff=0.25, max_tip_length_to_length_ratio=0.25, max_stroke_width_to_length_ratio=5, preserve_tip_size_when_scaling=True, **kwargs)[source]

Bases: manim.mobject.geometry.Line

Methods

get_default_tip_length

get_normal_vector

reset_normal_vector

scale

Scale an arrow, but keep stroke width and arrow tip size fixed.

set_stroke_width_from_length

Attributes

animate

Used to animate the application of a method.

scale(factor, scale_tips=False, **kwargs)[source]

Scale an arrow, but keep stroke width and arrow tip size fixed.

See also

scale()

Examples

>>> arrow = Arrow(np.array([-1, -1, 0]), np.array([1, 1, 0]), buff=0)
>>> scaled_arrow = arrow.scale(2)
>>> scaled_arrow.get_start_and_end()
(array([-2., -2.,  0.]), array([2., 2., 0.]))
>>> arrow.tip.length == scaled_arrow.tip.length
True

Manually scaling the object using the default method scale() does not have the same properties:

>>> new_arrow = Arrow(np.array([-1, -1, 0]), np.array([1, 1, 0]), buff=0)
>>> another_scaled_arrow = VMobject.scale(new_arrow, 2)
>>> another_scaled_arrow.tip.length == arrow.tip.length
False