Professional Documents
Culture Documents
If we insert the point blue of the image, in the side of the oranges we obtain the valued
that we imagined.
Name: Vélez Cortés Eduardo Arturo
Group: 2MM12 Date: 20/04/2020
%% 3d plot
[x,y] = meshgrid(-2:0.1:2);
pv = [0,-(b/W(2)),0];
ph = [-(b/W(1)),0,0];
pz = [0,0,-(b/W(3))];
Phv= pv-ph;
Phz= pz-ph;
Vn= cross(Phv, Phz);
z = ( Vn(1)*(x-ph(1)) + Vn(2)*y )/( Vn(3) );
figure (1)
hold on;
surf (x,y,z)
plot3 (1,-1,-1, 'b o');
plot3 (1,1,-1, 'r o');
xlabel('x');
ylabel('y');
zlabel('z');
%% While cycle
desition = 1;
while (desition == 1)
Vector = input('Introduce the point value among [], and in a vector form:
')
Pi = Vector;
a=hardlims(W*[Pi(1,1);Pi(1,2);Pi(1,3)]+b);
if a == -1
imshow('Orange.jpeg');
else
imshow('Apple.jpeg');
end
desition = input('Again (yes:1 No:0): ')
end