3D Sine‑to‑Cosine Transformation
Đang tải video…
Animation Specification: 3D Sine‑to‑Cosine Transformation (Defaults)
1. Overview
Create a Manim animation that displays a sine wave plotted in a 3‑D coordinate system and smoothly morphs it into a cosine wave. All parameters will use sensible defaults.
2. Mathematical Elements
- Domain:
- Initial Curve: (plotted on the -plane, with )
- Final Curve: (same plane)
- Interpolation: For the morph, use a parameter and define the intermediate curve as:
This will be animated by Manim’sTransform.
3. Visual Elements
- Axes: 3‑D axes (
ThreeDAxes) with range:- :
- :
- : (kept flat for visual balance)
- Grid: Enabled on the -plane for reference.
- Curves:
- Sine curve:
ParametricFunctioncolored BLUE, stroke width 4. - Cosine curve: Same style, colored RED.
- Sine curve:
- Title: "Sine Cosine Transformation" placed at the top, using
Textwith a semi‑transparent background. - Labels:
- Axis labels: "x", "y", "z".
- Optional small markers at the start and end points of the curves (optional, default: none).
4. Animation Timing & Transitions
| Segment | Duration | Description |
|---|---|---|
| 1. Intro (axes fade‑in) | 1.0 s | Create the axes and grid. |
| 2. Plot sine curve | 1.0 s | Create the blue sine curve. |
| 3. Pause | 0.5 s | Hold the sine curve. |
| 4. Morph to cosine | 2.5 s | Transform the sine curve into the red cosine curve using the interpolation defined above. |
| 5. Hold final curve | 0.5 s | Pause on the cosine curve. |
| 6. Fade out | 0.5 s | Fade out all objects. |
Total runtime ≈ 6 seconds.
5. Camera Settings
- Perspective: Static camera positioned to view the 3‑D axes at an angle of elevation and azimuth (Manim default for
ThreeDAxes). - No movement during the morph; the camera remains fixed.
6. Rendering Settings (Defaults)
- Resolution: 1920×1080 (HD)
- Background color: White (
#FFFFFF) - Frame rate: 30 fps
- Quality:
high_quality(Manim default)
7. Implementation Sketch (Manim Community Edition)
from manim import *
class SineToCosine3D(ThreeDScene):
def construct(self):
# Axes
axes = ThreeDAxes(
x_range=[0, 2*PI, PI/2],
y_range=[-1.5, 1.5, 0.5],
z_range=[-0.5, 0.5, 0.5],
axis_config={"include_tip": True},
)
axes.add_coordinate_labels()
self.set_camera_orientation(phi=30 * DEGREES, theta=45 * DEGREES)
self.play(Create(axes), run_time=1)
# Sine curve
sine = ParametricFunction(
lambda t: axes.c2p(t, np.sin(t), 0),
t_range=[0, 2*PI],
color=BLUE,
stroke_width=4,
)
self.play(Create(sine), run_time=1)
self.wait(0.5)
# Cosine curve (target)
cosine = ParametricFunction(
lambda t: axes.c2p(t, np.cos(t), 0),
t_range=[0, 2*PI],
color=RED,
stroke_width=4,
)
# Morph
self.play(Transform(sine, cosine), run_time=2.5)
self.wait(0.5)
# Title
title = Text("Sine → Cosine Transformation", font_size=36).to_edge(UP)
self.add(title)
# Fade out
self.play(FadeOut(VGroup(axes, sine, title)), run_time=0.5)
Note: This specification follows the user’s instruction to use the defaults. If any parameter should be changed (e.g., longer domain, camera motion, different colors), please let me know.
Tạo bởi
Mô tả
A short Manim animation shows a sine curve plotted on a 3‑D coordinate system that smoothly morphs into a cosine curve. The scene includes labeled three‑dimensional axes, a grid on the xy‑plane, and a title. The transformation uses linear interpolation between sin x and cos x, demonstrating the continuous shift from one wave to the other over a six‑second runtime.
Ngày tạo
Dec 31, 2025, 12:50 PM
Thẻ
Trạng thái
Nhân bản
Sao chép animation này vào tài khoản để chỉnh sửa và xuất bản phiên bản của bạn. Cần đăng nhập.