Skip to main content
Home
Jhun Vert

Main navigation

Breadcrumb

  1. Home
  2. Manim

Creating a Circle Using Parametric Equations With Manim

Tuesday, November 3, 2020

Below is the Python code, calling the Manim library, for creating a circle using parametric equations. The circle is parallel to the xy-plane and has a radius of 4 units . It is located 2 units above the xy-plane.

from manimlib.imports import *

class PlaneCircle(ThreeDScene):
    def construct(self):
        xyz = ThreeDAxes()
        Circ = ParametricSurface(
            self.CircleParam,
            u_min=0,
            u_max=TAU,
            v_min=0,
            v_max=np.arctan(2),
            resolution=(60,20)
        ).set_fill(opacity=0.8)

        self.set_camera_orientation(phi=75 * DEGREES)
        self.begin_ambient_camera_rotation(rate=0.2)

        self.play(ShowCreation(xyz), run_time=1.5)
        self.play(Write(Circ), run_time=3)
        self.wait(8)
    
    def CircleParam(self, u, v):
        return [ 
            2*np.tan(v)*np.sin(u),
            2*np.tan(v)*np.cos(u),
            2
        ]

Output video:

Category
Manim

Tags

  • Parametric Equations
  • Circle
  • Python
  • ThreeDScene
  • Add new comment

Comments

More in Manim

  • How to install Manim CE in Mac OS
  • Update the value of a function in Manim
  • Tracing a portion of a graph and moves along that portion using Manim updater
  • Creating a Circle Using Parametric Equations With Manim
  • Create Spherical Zone With Manim
  • Create a Partial Cylindrical Surface With Manim
  • Commands on Rendering Manim Videos: 3Blue1Brown vs ManimCE
more
               
Jhun Vert
About
Disclaimer
Privacy Policy
Projects
Contact
MATHalino
Website
YouTube
Twitter
FaceBook
Instagram
Powered by Drupal