#117·videos

VectorField not properly instantiated?

Author: abdallahsoliman00Created May 22, 2025Updated May 22, 2025

In _2024/holograms/diffraction.py, there is an instance of VectorField that is missing the coordinate_system argument on line 400:

linear_field = VectorField(field_func, sample_points=wave_line.get_points()[::4], max_vect_len=2.0)

Is this an error or is the code supposed to run normally?

Error message:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[3], line 7
      4     result[:, 1] = wave_amp_tracker.get_value() * wave.wave_func(points)
      5     return result
----> 7 linear_field = VectorField(field_func, sample_points=wave_line.get_points()[::4], max_vect_len=2.0)
        wave_line = <manimlib.mobject.geometry.Line object at 0x00000139F1794C20>
      8 linear_field.always.update_vectors()
      9 linear_field.set_stroke(WHITE, width=1.5, opacity=0.75)

TypeError: VectorField.__init__() missing 1 required positional argument: 'coordinate_system'