>>26 I can only hope octave will be able to paint the screen nearly as quickly as this one day soon. Plebian is good though, i'd say the greatest downside of assembly is that it is just too exotic.
>>25, 27 Closed source 'should' be a step or two ahead of open source, since there is an open source reference / standard, doing worse than the freely available standard, in theory shouldn't happen..
Anyway, here's my first working polygon script =)
function [atx, atz] = getAngles(pointmat)
p2 = pointmat([2:end,1],:) .- pointmat(1:end,:);
tx = 360.0 .- (atan2(p2(:,1), p2(:,2)) .* (180.0 / pi) .+ 180.0);
tx([2,3,1],2) = mod(tx + 180.0, 360)
zero_broken_angle = (abs(tx(:,1) .- tx(:,2)) < 180)
greaterFirst = tx(zero_broken_angle, 1) > tx(zero_broken_angle, 2)
atx = tx(zero_broken_angle, greaterFirst)
patx = [1:3];
patz = patx(zero_broken_angle);
atz = [patz(greaterFirst), patz(greaterFirst==0)]
if (sum(greaterFirst==0) > 0)
aty(:,[2,1]) = tx(zero_broken_angle, greaterFirst == 0)
endif;
atx = [atx, aty]
endfunction
function ret = autopainterpolyX(imSize)
point3 = [400,250; 200,200; 250,350;];
[rx, rz] = getAngles(point3)
nmat = [1:imSize];
nmat = nmat(ones(imSize,1),:);
tx = 360 .- (atan2(nmat .- point3(rz(1),1) , nmat' .- point3(rz(1),2)) .* (180.0 / pi) .+ 180);
tx2 = 360 .- (atan2(nmat .- point3(rz(2),1) , nmat' .- point3(rz(2),2)) .* (180.0 / pi) .+ 180);
tz = +(tx < rx(1,1) & tx > rx(1,2)) & (tx2 < rx(2,1) & tx2 > rx(2,2));
imshow(tz);
endfunction;