function varargout = Dreieck(varargin)
% DREIECK M-file for Dreieck.fig

% Last Modified by GUIDE v2.5 29-Jan-2007 15:10:30

% Begin initialization code - DO NOT EDIT
   gui_Singleton = 1;
   gui_State = struct('gui_Name',       mfilename, ...
                      'gui_Singleton',  gui_Singleton, ...
                      'gui_OpeningFcn', @Dreieck_OpeningFcn, ...
                      'gui_OutputFcn',  @Dreieck_OutputFcn, ...
                      'gui_LayoutFcn',  [] , ...
                      'gui_Callback',   []);
   if nargin && ischar(varargin{1})
       gui_State.gui_Callback = str2func(varargin{1});
   end

   if nargout
       [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
   else
       gui_mainfcn(gui_State, varargin{:});
   end
% End initialization code - DO NOT EDIT


% --- Executes just before Dreieck is made visible.
function Dreieck_OpeningFcn(hObject, eventdata, handles, varargin)
   % Choose default command line output for Dreieck
   handles.output = hObject;

   % Update handles structure
   guidata(hObject, handles);

   % UIWAIT makes Dreieck wait for user response (see UIRESUME)
   % uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = Dreieck_OutputFcn(hObject, eventdata, handles) 
   % Get default command line output from handles structure
   varargout{1} = handles.output;


% --------------------------------------------------------------------
function Dreieck_Callback(hObject, eventdata, handles)
% hObject    handle to Dreieck (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function Pick_Callback(hObject, eventdata, handles)
   % x-y-Ausschnitt fest definieren 
   axis( [0 10 0 10] );

   % 1. Punkt mit der Maus auswählen und 
   % die x-Koordinate des Punktes an x1, 
   % die y-Koordinate an y1 zurückgeben 
   [x1,y1] = ginput(1);
   
   % 2. Punkt mit der Maus auswählen  
   [x2,y2] = ginput(1);
   
   % 3. Punkt mit der Maus auswählen  
   [x3,y3] = ginput(1);

   % Arrays zum Plotten belegen 
   x = [x1, x2, x3, x1]; 
   y = [y1, y2, y3, y1]; 
   
   % Plot-Ausgabe des Dreiecks 
   plot(x,y);
   % x-y-Ausschnitt fest definieren 
   axis( [0 10 0 10] );
