Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
POLYGON INSIDE A POLYGON
%To view plots after 'plot' (and other plot-producing commands) this command must follow: 'print -dpng some_unique_plot_name.png;' %It exports current plot to png image which then is sent to your browser %GNU Octave 4.2.2 n = 3; a = 0.1; k = 0:n-1; x = cos(3*pi/2+pi/n+2*pi*k/n); y = sin(3*pi/2+pi/n+2*pi*k/n); k1 = 1:n; k1(n+1) = 1; function [x1,y1] = f(x,y,n,k1,a) for i = 1:n x1(i) = (x(k1(i+1))-x(k1(i)))*a + x(k1(i)); y1(i) = (y(k1(i+1))-y(k1(i)))*a + y(k1(i)); end end t = 0:0.01:1; hold on for j = 1:10 for i = 1:n x1 = (x(k1(i+1))-x(k1(i)))*t + x(k1(i)); y1 = (y(k1(i+1))-y(k1(i)))*t + y(k1(i)); plot(x1,y1,"Linewidth",2,"Color",'b'); end [x1,y1] = f(x,y,n,k1,a); x = x1; y = y1; end print -dpng saif.png;
run
|
edit
|
history
|
help
2
test1.m
POLYGON 2
Example Plot for MTE111 Lab Reports
Krylov.m
Pascal triangle in array programming: APL and GNU Octave + Mastrave
prog2
euler
zeros of legendre's polynomial
1sttest.m
calc_RCA1_component_amounts