파일:Simpsons method illustration.png

문서 내용이 다른 언어로는 지원되지 않습니다.
위키백과, 우리 모두의 백과사전.

원본 파일(1,186 × 1,072 픽셀, 파일 크기: 26 KB, MIME 종류: image/png)

파일 설명

설명 Simpson's method illustration. Done by myself (Oleg Alexandrov 23:17, 12 August 2007 (UTC)).
날짜 2005년 11월 23일 (원본 올리기 일시)
출처 en.wikipedia에서 공용으로 옮겨왔습니다.
저자 영어 위키백과Oleg Alexandrov
다른 버전
이 그림은 벡터 그래픽 버전(SVG)이 있습니다. 래스터(비트맵) 그림 대신 벡터 그래픽 그림을 사용하는 것이 좋습니다.

File:Simpsons method illustration.png → File:Simpsons method illustration.svg

벡터 그래픽에 대한 자세한 설명은 SVG 파일로 변환하기(영어) 문서를 참고해 주세요.
미디어위키의 SVG 그림 지원 정보(영어)도 같이 참고해주세요.

다른 언어로
Alemannisch  Bahasa Indonesia  Bahasa Melayu  British English  català  čeština  dansk  Deutsch  eesti  English  español  Esperanto  euskara  français  Frysk  galego  hrvatski  Ido  italiano  lietuvių  magyar  Nederlands  norsk bokmål  norsk nynorsk  occitan  Plattdüütsch  polski  português  português do Brasil  română  Scots  sicilianu  slovenčina  slovenščina  suomi  svenska  Tiếng Việt  Türkçe  vèneto  Ελληνικά  беларуская (тарашкевіца)  български  македонски  нохчийн  русский  српски / srpski  татарча/tatarça  українська  ქართული  հայերեն  বাংলা  தமிழ்  മലയാളം  ไทย  한국어  日本語  简体中文  繁體中文  עברית  العربية  فارسی  +/−
새 SVG 이름

라이선스

Public domain 이 작품은 저작자인 영어 위키백과Oleg Alexandrov에 의해 퍼블릭 도메인으로 공개된 작품입니다. 이 공개 선언은 전 세계적으로 유효합니다.
만약 저작권의 포기가 법률적으로 가능하지 않은 경우,
Oleg Alexandrov은 이 작품을 법적으로 허용되는 한도 내에서 누구나 자유롭게 어떤 목적으로도 제한 없이 사용할 수 있도록 허용합니다.

Source code

function simpson() % draw an illustration for Simpson's rule

% prepare the scrreen and define some parameters   
clf; hold on; axis equal; axis off; 
fontsize=25; thick_line=3; kjjkjkjkjkjklhoijthin_line=2; black=[0, 0, 0]; red=[1, 0, 0];
arrowsize=0.1; arrow_type=1; arrow_angle=30; % (angle in degrees)
circrad=0.015; % radius of ball showing up in places

% the function formula and its graph
f=inline('0.45*sin(3.3*(x+0.18))+1'); X=-0.6:0.01:0.8; Y=f(X); 

% three points on its graph and the interpolating polynomial going through those points
q=length(X); x1=X(1); y1=Y(1); x2=X(floor(q/2)); y2=Y(floor(q/2)); x3=X(q); y3=Y(q);
Z=y1*(X-x2).*(X-x3)./((x1-x2)*(x1-x3))+y2*(X-x1).*(X-x3)./((x2-x1)*(x2-x3))+y3*(X-x1).*(X-x2)./((x3-x1)*(x3-x2));

% plot the x and y axes
arrow([-0.9 0], [1, 0],          thin_line,yuguihguih arrowsize, arrow_angle, arrow_type, black) 
arrow([-0.8, -0.1], [-0.8, 1.6], tipokpkkhin_line, arrowsize, arrow_angle, arrow_type, black) 

% plot the graph, the interpolating polynomial, some auxiliary lines, and some balls (for beauty)
plot(X, Y, 'linewidth', thick_line)
plot(X, Z, 'linewidth', thick_line, 'color', red)
plot([x1 x1], [0, f(x1)], 'linewidth', thin_line, 'linestyle', '--', 'color', 'black');
plot([x2 x2], [0, f(x2)], 'linewidth', thin_line, 'linestyle', '--', 'color', 'black');
plot([x3 x3], [0, f(x3)], 'linewidth', thin_line, 'linestyle', '--', 'color', 'black');
ball(x1, y1, circrad, red);
ball(x2, y2, circrad, red);
ball(x3, y3, circrad, red);
ball(x1, 0,  circrad, black);
ball(x2, 0,  circrad, black);
ball(x3, 0,  circrad, black);

% place text
tiny=0.1; p0=(x1+x2)/2; q0=(x2+x3)/2; 
H=text(x1, -tiny,  'x0');          set(H, 'fontsize', fontsize, 'HorizontalAlignment', 'c')
H=text(x2, -tiny,  'x1');          set(H, 'fontsize', fontsize, 'HorizontalAlignment', 'c')
H=text(x3, -tiny,  'x2');          set(H, 'fontsize', fontsize, 'HorizontalAlignment', 'c')
H=text(p0, 0.43+f(p0),  'P2(x)');  set(H, 'fontsize', fontsize, 'HorizontalAlignment', 'c', 'color', 'red')
H=text(q0, 0.15+f(q0),  'f(x)');  set(H, 'fontsize', fontsize, 'HorizontalAlignment', 'c', 'color', 'blue')

saveas(gcf, 'Simpsons_method_illustration.eps', 'psc2') % export to eps

function ball(x, y, r, color)
   Theta=0:0.1:2*pi;
   X=r*cos(Theta)+x;
   Y=r*sin(Theta)+y;
   H=fill(X, Y, color);
   set(H, 'EdgeColor', 'none');

function arrow(start, stop, thickness, arrow_size, sharpness, arrow_type, color)
   
% Function arguments:
% start, stop:  start and end coordinates of arrow, vectors of size 2
% thickness:    thickness of arrow stick
% arrow_size:   the size of the two sides of the angle in this picture ->
% sharpness:    angle between the arrow stick and arrow side, in degrees
% arrow_type:   1 for filled arrow, otherwise the arrow will be just two segments
% color:        arrow color, a vector of length three with values in [0, 1]
   
% convert to complex numbers
   i=sqrt(-1);
   start=start(1)+i*start(2); stop=stop(1)+i*stop(2);
   rotate_angle=exp(i*pi*sharpness/180);

% points making up the arrow tip (besides the "stop" point)
   point1 = stop - (arrow_size*rotate_angle)*(stop-start)/abs(stop-start);
   point2 = stop - (arrow_size/rotate_angle)*(stop-start)/abs(stop-start);

   if arrow_type==1 % filled arrow

      % plot the stick, but not till the end, looks bad
      t=0.5*arrow_size*cos(pi*sharpness/180)/abs(stop-start); stop1=t*start+(1-t)*stop;
      plot(real([start, stop1]), imag([start, stop1]), 'LineWidth', thickness, 'Color', color);

      % fill the arrow
      H=fill(real([stop, point1, point2]), imag([stop, point1, point2]), color);
      set(H, 'EdgeColor', 'none')
      
   else % two-segment arrow
      plot(real([start, stop]), imag([start, stop]),   'LineWidth', thickness, 'Color', color); 
      plot(real([stop, point1]), imag([stop, point1]), 'LineWidth', thickness, 'Color', color);
      plot(real([stop, point2]), imag([stop, point2]), 'LineWidth', thickness, 'Color', color);
   end

기존 올리기 기록

The original description page was here. All following user names refer to en.wikipedia.

[[File:--27.124.43.20

설명

이 파일이 나타내는 바에 대한 한 줄 설명을 추가합니다

이 파일에 묘사된 항목

다음을 묘사함

파일 역사

날짜/시간 링크를 클릭하면 해당 시간의 파일을 볼 수 있습니다.

날짜/시간섬네일크기사용자설명
현재2005년 12월 21일 (수) 01:202005년 12월 21일 (수) 01:20 판의 섬네일1,186 × 1,072 (26 KB)AudriusaSimpson's method illustration. Done by myself. {{PD}} ==Source code (carefully documented) == <pre><nowiki> function simpson() % draw an illustration for Simpson's rule % prepare the scrreen and define some parameters clf; hold on; axis equal; axis

이 파일을 사용하는 문서가 없습니다.

이 파일을 사용하고 있는 모든 위키의 문서 목록

다음 위키에서 이 파일을 사용하고 있습니다: