• Remix
  • Share
  • New Entry

on 8 Oct 2024
  • 11
  • 129
  • 0
  • 0
  • 493
Cite your audio source here (if applicable):
drawframe(50);
Write your drawframe function below
function drawframe(f)
% Parameters
N = 600; % Grid size
[X, Y] = meshgrid(linspace(-1.5, 1.5, N)); % Create grid
R = sqrt(X.^2 + Y.^2); % Distance from center
% Sun properties
sunRadius = 0.5; % Radius of the sun
sun = exp(-((R - sunRadius).^2) * 50); % Sun intensity distribution
% Moon properties
moonRadius = 0.55; % Radius of the moon
moonCenterX = 1.5 * cos(2 * pi * f / 192); % Moon's X position
moonCenterY = 0; % Moon's Y position
moon = exp(-((sqrt((X - moonCenterX).^2 + (Y - moonCenterY).^2) - moonRadius).^2) * 100);
% Eclipse effect
eclipse = max(sun - 1 * moon, 0); % Subtract moon from sun
% Corona effect
corona = 0.3 * exp(-((R - sunRadius).^2) * 10); % Faint corona around the sun
eclipse = eclipse + corona; % Add corona to the eclipse
% Display the eclipse
img = ind2rgb(gray2ind(mat2gray(eclipse), 256), hot(256)); % Use 'hot' colormap for sun-like colors
imshow(img, 'InitialMagnification', 'fit');
axis off; % Remove axis
end
Movie
Audio

This submission does not have audio.

Remix Tree