Skip to content

Commit

Permalink
Jacobian polar to cartesian 영상으로 하나 녹화
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloyeo committed Nov 30, 2020
1 parent 84ebeb8 commit b670c47
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,28 @@

%% 비선형 변환 + 원의 넓이 구하기

applying_jacobian = 0; % jacobian 적용 여부

if applying_jacobian == 0
v = VideoWriter('polar_to_xy_circle_area_no_Jaco.mp4','MPEG-4');
elseif applying_jacobian == 1
v = VideoWriter('polar_to_xy_circle_area_with_Jaco.mp4','MPEG-4');
end

v.FrameRate = 30;
v.Quality = 100;
open(v);

clear F

close all
n_steps = 50;
n_steps = 100;
n_points = 100; % 이 값이 클 수록 촘촘하게 그려질 것이다.
size = 10;
my_colors = jet(n_points^2);
r = 2; % radius

applying_jacobian = 1; % jacobian 적용 여부


[R,THETA] = ndgrid(linspace(0,r,n_points),linspace(0,2*pi,n_points));
scatter(R(:),THETA(:),size,my_colors,'filled')
Expand All @@ -173,7 +187,7 @@
%%% 함수 %%%
new_R = R(:)+changeR*i_step/n_steps;
new_THETA = THETA(:)+changeTHETA*i_step/n_steps;

set(gcf,'color','w')
if applying_jacobian == 0
scatter(new_R,new_THETA,size,my_colors,'filled'); hold on;
else
Expand All @@ -199,6 +213,20 @@
axis square
drawnow;
% pause;

F(i_step+1)=getframe(gcf);

end

for i_step = n_steps+1:n_steps+50
F(i_step+1)=getframe(gcf);
end

for i=1:length(F)
% convert the image to a frame
frame = F(i) ;
writeVideo(v, frame);
end

close(v)

0 comments on commit b670c47

Please sign in to comment.