Equal arc discretization method code
%% Archimedean spiral points with Equal angle discretization method
clear all
clc
% Parameters
R2 = 30; %outer radius (between this radius and R1 is constant arc increment)
b = 2; %incerement per rev, equivalent to feed
a = 0; %inner radius
n = round((R2 – a)./(b)); %number of revolutions and number of
th = 2*n*pi; %angle obtained for n number of revolution, for one revoultion 2*pi
%% parameters defined for constant angle like incremental x value and theta value
dtheta= 1; %% incremental angle (degree)
eqangle= dtheta* pi/(180); %% equal angle obtianed for each spiral revolution
npt= 2*pi/(eqangle); %% number of points in each spiral
tpoints= (npt*n)+1; %% total number of points in n number of revolutions
theta = linspace(0,th,tpoints);
r= a + b.*theta./(2*pi);
% Convert polar coordinates to Cartesian coordinates
xr = r.* cos(theta);
yr = r.* sin(theta);
plot(xr, yr, ‘-o’);
NOTE:
The above code works well for equal angle discretization method. The code consists the information about equal angle i.e, 1 degree, the total number of points, number of points in each spiral, total angle obtained, etc.
Simialry the code for equal arc length discretization method should cosnsists the following information such as for incremental arc length i.e., 1 mm, what is number of points around the edge, spiral length, total number of points etc
Please help to developed the code based on the above information.
Looking forward for the improvement in above code%% Archimedean spiral points with Equal angle discretization method
clear all
clc
% Parameters
R2 = 30; %outer radius (between this radius and R1 is constant arc increment)
b = 2; %incerement per rev, equivalent to feed
a = 0; %inner radius
n = round((R2 – a)./(b)); %number of revolutions and number of
th = 2*n*pi; %angle obtained for n number of revolution, for one revoultion 2*pi
%% parameters defined for constant angle like incremental x value and theta value
dtheta= 1; %% incremental angle (degree)
eqangle= dtheta* pi/(180); %% equal angle obtianed for each spiral revolution
npt= 2*pi/(eqangle); %% number of points in each spiral
tpoints= (npt*n)+1; %% total number of points in n number of revolutions
theta = linspace(0,th,tpoints);
r= a + b.*theta./(2*pi);
% Convert polar coordinates to Cartesian coordinates
xr = r.* cos(theta);
yr = r.* sin(theta);
plot(xr, yr, ‘-o’);
NOTE:
The above code works well for equal angle discretization method. The code consists the information about equal angle i.e, 1 degree, the total number of points, number of points in each spiral, total angle obtained, etc.
Simialry the code for equal arc length discretization method should cosnsists the following information such as for incremental arc length i.e., 1 mm, what is number of points around the edge, spiral length, total number of points etc
Please help to developed the code based on the above information.
Looking forward for the improvement in above code %% Archimedean spiral points with Equal angle discretization method
clear all
clc
% Parameters
R2 = 30; %outer radius (between this radius and R1 is constant arc increment)
b = 2; %incerement per rev, equivalent to feed
a = 0; %inner radius
n = round((R2 – a)./(b)); %number of revolutions and number of
th = 2*n*pi; %angle obtained for n number of revolution, for one revoultion 2*pi
%% parameters defined for constant angle like incremental x value and theta value
dtheta= 1; %% incremental angle (degree)
eqangle= dtheta* pi/(180); %% equal angle obtianed for each spiral revolution
npt= 2*pi/(eqangle); %% number of points in each spiral
tpoints= (npt*n)+1; %% total number of points in n number of revolutions
theta = linspace(0,th,tpoints);
r= a + b.*theta./(2*pi);
% Convert polar coordinates to Cartesian coordinates
xr = r.* cos(theta);
yr = r.* sin(theta);
plot(xr, yr, ‘-o’);
NOTE:
The above code works well for equal angle discretization method. The code consists the information about equal angle i.e, 1 degree, the total number of points, number of points in each spiral, total angle obtained, etc.
Simialry the code for equal arc length discretization method should cosnsists the following information such as for incremental arc length i.e., 1 mm, what is number of points around the edge, spiral length, total number of points etc
Please help to developed the code based on the above information.
Looking forward for the improvement in above code equal arc discretization MATLAB Answers — New Questions