Last active
December 17, 2015 12:09
-
-
Save LucaTNT/5607273 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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