% THIS IS THE 2D SIMULATION
close all; clear all; clc;
N = 100;
Theta = linspace(0, pi, N);
R_out = 14; R_in = 10;

%% Init
Ax = R_out*cos(Theta); Ay = R_out*sin(Theta);
Bx = R_in*cos(Theta); By = R_in*sin(Theta);

Ao = sqrt((Ax(1:(end-1)) - Ax(2:end)).^2 + (Ay(1:(end-1)) - Ay(2:end)).^2);
Bo = sqrt((Bx(1:(end-1)) - Bx(2:end)).^2 + (By(1:(end-1)) - By(2:end)).^2);
Lo = sqrt((Ax - Bx).^2 + (Ay - By).^2);

V1x = Ax(1:(end-1)) - Ax(2:end); V2x = Ax(1:(end-1)) - Bx(2:end); V3x = Ax(1:(end-1)) - Ax(1:(end-1));
V1y = Ay(1:(end-1)) - Ay(2:end); V2y = Ay(1:(end-1)) - By(2:end); V3y = Ay(1:(end-1)) - Ay(1:(end-1));
Vo = abs(V1x.*V2y - V1y.*V2x)/2 + abs(V2x.*V3y - V2y.*V3x)/2;

figure, hold on;
plot(Ax, Ay, 'r-*', 'linewidth', 2); plot(Bx, By, 'b-*', 'linewidth', 2);
for i=1:N, plot([Ax(i) Bx(i)], [Ay(i) By(i)], 'k', 'linewidth', 2);end;axis equal;
title('Initial Position');

%%


