2.2 - Figur - Området y mindre än 3x - 4
Förberedande kurs i matematik 1
(Skillnad mellan versioner)
(Ny sida: <noinclude>Detta är en figur som används i svaret till övning 2.2:8 och är ritad i språket [http://en.wikipedia.org/wiki/Metapost Metapost]. Du kan red...) |
|||
Rad 72: | Rad 72: | ||
dy := dx; % vertical distance between grid lines | dy := dx; % vertical distance between grid lines | ||
- | Lx_lft := | + | Lx_lft := 4*dx+2pt; % Length of the left-hand part of the x-axis |
- | Lx_rt := | + | Lx_rt := 4*dx+2pt; % Length of the right-hand part of the x-axis |
- | Ly_lwr := | + | Ly_lwr := 4*dy+4pt; % Length of the lower part of the y-axis |
- | Ly_upr := | + | Ly_upr := 4*dy+4pt; % Length of the upper part of the y-axis |
ahangle := 30; % Angle of the arrow tip | ahangle := 30; % Angle of the arrow tip | ||
Rad 90: | Rad 90: | ||
vardef finv(expr y) = (y+4)/3 enddef; | vardef finv(expr y) = (y+4)/3 enddef; | ||
path p_solid; | path p_solid; | ||
- | p_solid := (wiggle ((finv(( | + | p_solid := (wiggle ((finv((4*dy+2bp/sqrt(2))/(dy))*dx,4*dy+2bp/sqrt(2)) |
- | --( | + | --(4*dx,4*dy+2bp/sqrt(2)))) |
- | & (wiggle (( | + | & (wiggle ((4*dx,4*dy+2bp/sqrt(2)) |
- | --( | + | --(4*dx,-4*dx-2bp/sqrt(2)))) |
- | & (wiggle (( | + | & (wiggle ((4*dx,-4*dx-2bp/sqrt(2)) |
- | --(finv((- | + | --(finv((-4*dx-2bp/sqrt(2))/(dy))*dx,-4*dx-2bp/sqrt(2)))) |
--cycle; | --cycle; | ||
pickup nullpen; | pickup nullpen; | ||
Rad 128: | Rad 128: | ||
% The straight line | % The straight line | ||
path p_line; | path p_line; | ||
- | p_line := (- | + | p_line := (-4*dx,f(-4)*dy)--(4*dx,f(4)*dy); |
s := xpart (p_line intersectiontimes ((-Lx_lft,-Ly_lwr)--(Lx_rt,-Ly_lwr))); | s := xpart (p_line intersectiontimes ((-Lx_lft,-Ly_lwr)--(Lx_rt,-Ly_lwr))); | ||
t := xpart (p_line intersectiontimes ((-Lx_lft,Ly_upr)--(Lx_rt,Ly_upr))); | t := xpart (p_line intersectiontimes ((-Lx_lft,Ly_upr)--(Lx_rt,Ly_upr))); | ||
Rad 136: | Rad 136: | ||
linecap := rounded; | linecap := rounded; | ||
drawoptions(); | drawoptions(); | ||
- | |||
- | % Tick marks | ||
- | pickup pencircle scaled 0.4pt; | ||
- | for x=2dx step 2dx until infinity: | ||
- | exitif x>Lx_rt-4pt; | ||
- | draw (x,-1.5pt)--(x,1.5pt); | ||
- | endfor | ||
- | for x=-2dx step -2dx until -infinity: | ||
- | exitif x<-Lx_lft+2pt; | ||
- | draw (x,-1.5pt)--(x,1.5pt); | ||
- | endfor | ||
- | for y=2dy step 2dy until infinity: | ||
- | exitif y>Ly_upr-6pt; | ||
- | draw (-1.5pt,y)--(1.5pt,y); | ||
- | endfor | ||
- | for y=-2dy step -2dy until -infinity: | ||
- | exitif y<-Ly_lwr+2pt; | ||
- | draw (-1.5pt,y)--(1.5pt,y); | ||
- | endfor | ||
% Rescale the image | % Rescale the image |
Nuvarande version
Detta är en figur som används i svaret till övning 2.2:8 och är ritad i språket Metapost. Du kan redigera bilden genom att klicka på redigera-fliken.