Skip to content

Instantly share code, notes, and snippets.

@LucaTNT
Last active December 17, 2015 12:09
Show Gist options
  • Save LucaTNT/5607273 to your computer and use it in GitHub Desktop.
Save LucaTNT/5607273 to your computer and use it in GitHub Desktop.
% Programma per verificare che la mia chiusura del problema sia buona
% Link al testo: http://cl.ly/P3ia
% Immagine risultante: http://cl.ly/P4Zz
clear; close all; clc;
R = 10;
L = 15;
x_cir = @(x) R*sin(x);
y_cir = @(x) R*cos(x);
x_m = @(x) x_cir(x)-(L+R.*x).*cos(x);
y_m = @(x) y_cir(x)+(L+R.*x).*sin(x);
theta = [0:0.01:pi/2];
plot(x_m(theta), y_m(theta))
hold on
plot(x_m(0), y_m(0), 'ro')
plot(x_m(pi/2), y_m(pi/2), 'yo')
plot(x_cir(theta), y_cir(theta), 'k')
plot(-x_cir(theta), y_cir(theta), 'k')
for angolo = [0:pi/18:pi/2]
plot([x_m(angolo) x_cir(angolo)], [y_m(angolo) y_cir(angolo)], 'g')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment