File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -445,6 +445,45 @@ CONFIG = {
445
445
446
446
### 3D Graphing
447
447
448
+ ``` python
449
+ from big_ol_pile_of_manim_imports import *
450
+
451
+ class ThreedSurface (ParametricSurface ):
452
+
453
+ def __init__ (self , ** kwargs ):
454
+ kwargs = {
455
+ " u_min" : - 2 ,
456
+ " u_max" : 2 ,
457
+ " v_min" : - 2 ,
458
+ " v_max" : 2 ,
459
+ " checkerboard_colors" : [BLUE_D ]
460
+ }
461
+ ParametricSurface.__init__ (self , self .func, ** kwargs)
462
+
463
+ def func (self , x , y ):
464
+ return np.array([x,y,x** 2 - y** 2 ])
465
+
466
+ def tangentX (self , x , y ):
467
+ return 2 * x
468
+
469
+ class Test (ThreeDScene ):
470
+
471
+ def construct (self ):
472
+ self .set_camera_orientation(0.6 , - 0.7853981 , 86.6 )
473
+
474
+ surface = ThreeDSurface()
475
+ self .play(ShowCreation(surface))
476
+
477
+ d = Dot(np.array([0 ,0 ,0 ]), color = YELLOW )
478
+ self .play(ShowCreation(d))
479
+
480
+
481
+ self .wait()
482
+ self .move_camera(0.8 * np.pi/ 2 , - 0.45 * np.pi)
483
+ self .begin_ambient_camera_rotation()
484
+ self .wait(9 )
485
+ ```
486
+
448
487
** Click for results on YouTube:**
449
488
450
489
[ ![ Youtube video link] ( https://img.youtube.com/vi/_XMEQRshlp4/0.jpg )] ( https://www.youtube.com/watch?v=_XMEQRshlp4 )
You can’t perform that action at this time.
0 commit comments