Envelope of chords

Circle (red) & some of its chords (blue) (2014 (c) Andrew Irving, All rights reserved – please do not use without credit).

% Copyright Andrew D. Irving. 2014. All rights reserved.

% ENVELOPE OF CHORDS TO CIRCLE

% Parameter Values

n = 2*pi;       % n = number of radians
m = 4;          % m = factor

j = linspace(0, n, 900);           % Vector for parameter j in the range [ 0 , n ]

% Defining vectors for (x,y) parameterisation of circle

x = cos(j);

y = sin(j);

% Plot of circle

plot(x,y,’r’,’LineWidth’,3.5);        % Plot (x,y) in red (‘r’) using a line width of 3.5

hold on

% Defining vectors for (x1,y1) parameterisation of chords

for j = 0: pi / 50: 2*pi

a = cos(m*j);

b = sin(m*j);

hline1 = plot( [cos(j),a],[sin(j),b],’b’,’LineWidth’,2);

end

axis square     % Make the plane square rather than rectangular