Ellipse.m: Unterschied zwischen den Versionen

Aus HSHL Mechatronik
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „<code> function h=ellipse(ra,rb,ang,x0,y0,C,Nb) % Ellipse adds ellipses to the current plot % % ELLIPSE(ra,rb,ang,x0,y0) adds an ellipse with semimajor axis of…“)
 
Keine Bearbeitungszusammenfassung
 
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt)
Zeile 1: Zeile 1:
<code>
  function h=ellipse(ra,rb,ang,x0,y0,C,Nb)
function h=ellipse(ra,rb,ang,x0,y0,C,Nb)
  % Ellipse adds ellipses to the current plot
% Ellipse adds ellipses to the current plot
  %
%
  % ELLIPSE(ra,rb,ang,x0,y0) adds an ellipse with semimajor axis of ra,
% ELLIPSE(ra,rb,ang,x0,y0) adds an ellipse with semimajor axis of ra,
  % a semimajor axis of radius rb, a semimajor axis of ang, centered at
% a semimajor axis of radius rb, a semimajor axis of ang, centered at
  % the point x0,y0.
% the point x0,y0.
  %
%
  % The length of ra, rb, and ang should be the same.  
% The length of ra, rb, and ang should be the same.  
  % If ra is a vector of length L and x0,y0 scalars, L ellipses
% If ra is a vector of length L and x0,y0 scalars, L ellipses
  % are added at point x0,y0.
% are added at point x0,y0.
  % If ra is a scalar and x0,y0 vectors of length M, M ellipse are with the same  
% If ra is a scalar and x0,y0 vectors of length M, M ellipse are with the same  
  % radii are added at the points x0,y0.
% radii are added at the points x0,y0.
  % If ra, x0, y0 are vectors of the same length L=M, M ellipses are added.
% If ra, x0, y0 are vectors of the same length L=M, M ellipses are added.
  % If ra is a vector of length L and x0, y0 are  vectors of length
% If ra is a vector of length L and x0, y0 are  vectors of length
  % M~=L, L*M ellipses are added, at each point x0,y0, L ellipses of radius ra.
% M~=L, L*M ellipses are added, at each point x0,y0, L ellipses of radius ra.
  %
%
  % ELLIPSE(ra,rb,ang,x0,y0,C)
% ELLIPSE(ra,rb,ang,x0,y0,C)
  % adds ellipses of color C. C may be a string ('r','b',...) or the RGB value.  
% adds ellipses of color C. C may be a string ('r','b',...) or the RGB value.  
  % If no color is specified, it makes automatic use of the colors specified by  
% If no color is specified, it makes automatic use of the colors specified by  
  % the axes ColorOrder property. For several circles C may be a vector.
% the axes ColorOrder property. For several circles C may be a vector.
  %
%
  % ELLIPSE(ra,rb,ang,x0,y0,C,Nb), Nb specifies the number of points
% ELLIPSE(ra,rb,ang,x0,y0,C,Nb), Nb specifies the number of points
  % used to draw the ellipse. The default value is 300. Nb may be used
% used to draw the ellipse. The default value is 300. Nb may be used
  % for each ellipse individually.
% for each ellipse individually.
  %
%
  % h=ELLIPSE(...) returns the handles to the ellipses.
% h=ELLIPSE(...) returns the handles to the ellipses.
  %
%
  % as a sample of how ellipse works, the following produces a red ellipse
% as a sample of how ellipse works, the following produces a red ellipse
  % tipped up at a 45 deg axis from the x axis
% tipped up at a 45 deg axis from the x axis
  % ellipse(1,2,pi/8,1,1,'r')
% ellipse(1,2,pi/8,1,1,'r')
  %
%
  % note that if ra=rb, ELLIPSE plots a circle
% note that if ra=rb, ELLIPSE plots a circle
  %
%


% written by D.G. Long, Brigham Young University, based on the
% written by D.G. Long, Brigham Young University, based on the
Zeile 38: Zeile 37:
% written by Peter Blattner, Institute of Microtechnology, University of  
% written by Peter Blattner, Institute of Microtechnology, University of  
% Neuchatel, Switzerland, blattner@imt.unine.ch
% Neuchatel, Switzerland, blattner@imt.unine.ch
</code>

Aktuelle Version vom 9. Oktober 2021, 11:38 Uhr

 function h=ellipse(ra,rb,ang,x0,y0,C,Nb)
 % Ellipse adds ellipses to the current plot
 %
 % ELLIPSE(ra,rb,ang,x0,y0) adds an ellipse with semimajor axis of ra,
 % a semimajor axis of radius rb, a semimajor axis of ang, centered at
 % the point x0,y0.
 %
 % The length of ra, rb, and ang should be the same. 
 % If ra is a vector of length L and x0,y0 scalars, L ellipses
 % are added at point x0,y0.
 % If ra is a scalar and x0,y0 vectors of length M, M ellipse are with the same 
 % radii are added at the points x0,y0.
 % If ra, x0, y0 are vectors of the same length L=M, M ellipses are added.
 % If ra is a vector of length L and x0, y0 are  vectors of length
 % M~=L, L*M ellipses are added, at each point x0,y0, L ellipses of radius ra.
 %
 % ELLIPSE(ra,rb,ang,x0,y0,C)
 % adds ellipses of color C. C may be a string ('r','b',...) or the RGB value. 
 % If no color is specified, it makes automatic use of the colors specified by 
 % the axes ColorOrder property. For several circles C may be a vector.
 %
 % ELLIPSE(ra,rb,ang,x0,y0,C,Nb), Nb specifies the number of points
 % used to draw the ellipse. The default value is 300. Nb may be used
 % for each ellipse individually.
 %
 % h=ELLIPSE(...) returns the handles to the ellipses.
 %
 % as a sample of how ellipse works, the following produces a red ellipse
 % tipped up at a 45 deg axis from the x axis
 % ellipse(1,2,pi/8,1,1,'r')
 %
 % note that if ra=rb, ELLIPSE plots a circle
 %

% written by D.G. Long, Brigham Young University, based on the % CIRCLES.m original % written by Peter Blattner, Institute of Microtechnology, University of % Neuchatel, Switzerland, blattner@imt.unine.ch