TUSGraph: QUADratic Equations

Posted by at 10:40PM

Matlab code to trace out the main quad arcade (please no comments on my coding style…):

arch2 = 1.21;
arch3 = 16/9;
t1 = -1:.01:1;
litarch = .5+sqrt(1-t1.^2)./2;
medarch = real((.5+sqrt(arch2).*(sqrt((arch2-((-sqrt(arch2):.01/sqrt(arch2):sqrt(arch2))).^2)))./2));
bigarch = real((.5+sqrt(arch3).*(sqrt((arch3-((-sqrt(arch3):.01/sqrt(arch3):0)).^2)))./2));
small_col = zeros(1,ceil(length(litarch)/20*6));
half_col = zeros(1,ceil(length(litarch)/20));
big_col = zeros(1,ceil(length(litarch)/2));
x2 = [half_col litarch half_col];
x3 = [x2 x2 x2 x2 x2 x2 x2];
x8 = [x3 x3 big_col x2 big_col x2 big_col big_col half_col medarch half_col half_col small_col bigarch];
x10 = [x8 fliplr(x8)];
t10 = (0:1:length(x10)-1)./length(x10);
plot(t10/length(t1)*length(t10),x10);
axis(‘equal’);
hold on;
midsize = 2.75;
roof = 1.5.*ones(1,length(x10-1));
dim = max(t10/length(t1)*length(t10));
scale = t10/length(t1)*length(t10);
slantx = (dim/2-midsize:(t10(2)-t10(1)):dim/2);
slant = 1.5 + (slantx-dim/2+midsize).*(2.5-1.5)/midsize;
roof1 = scale*(dim/2 – midsize)/dim;
roof2 = dim-((scale*(dim/2 – midsize)/dim));
slant1 = dim/2 – midsize + scale*(5)/dim;
plot(roof1,roof);
plot(slantx,slant);
plot(slantx+midsize,fliplr(slant));
plot(roof2,roof);
axis off;
hold off;
print quad;

Share

2 Responses to “TUSGraph: QUADratic Equations”

  1. Lere says:

    You legend!

  2. Kevin says:

    that’s pretty cool

JOIN THE CONVERSATION - LEAVE A REPLY


Comments are moderated and will be posted if they are on-topic and not abusive. Please do not be alarmed if your comment does not show up immediately. We will get it posted soon.