|
| 1 | +#Description |
| 2 | +#Math for Elementary Education |
| 3 | +#End Description |
| 4 | + |
| 5 | +# DBsubject(Shapes) |
| 6 | +# DBchapter(Geometry) |
| 7 | +# DBsection(Area) |
| 8 | +# Date(2/21/22) |
| 9 | +# Institution(SUNY Oneonta) |
| 10 | +# Level(2) |
| 11 | +# KEYWORDS('area','perimeter') |
| 12 | + |
| 13 | +################################### |
| 14 | + |
| 15 | +DOCUMENT(); |
| 16 | +loadMacros( |
| 17 | +"PGstandard.pl", |
| 18 | +"PGchoicemacros.pl", |
| 19 | +"MathObjects.pl", |
| 20 | +"PGgraphmacros.pl", |
| 21 | +"PGauxiliaryFunctions.pl", #for lcm, gcd,etc |
| 22 | +); |
| 23 | + |
| 24 | +# make sure we're in the context we want |
| 25 | +Context("Numeric"); |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +$a = random(2,7,1); |
| 30 | +$b1 = random(2,5,1); |
| 31 | +$c = random(3,8,1); |
| 32 | +$b = $c+$b1; |
| 33 | +$d = "$b1^2+$a^2"; |
| 34 | + |
| 35 | +$ans1 = Compute("$b+$c+sqrt($d)+.5*pi*$a"); |
| 36 | +$ans2 =Compute("$a*$c-.5*pi*($a/2)^2+.5*$a*$b1"); |
| 37 | + |
| 38 | +($WIDTH,$HEIGHT,$TEXSIZE)=(270,370,300); |
| 39 | +# now initialize the graph |
| 40 | +$graph = init_graph(-.9,-.6, 3.2,4,size=>[$WIDTH,$HEIGHT]); |
| 41 | + |
| 42 | + |
| 43 | +$black=$graph->im->colorAllocate(0,0,0); |
| 44 | +$graph->im->arc(125,79,132,-132,180,360,$black); |
| 45 | + |
| 46 | + |
| 47 | +$graph->moveTo(0,1); |
| 48 | +$graph->lineTo(2 ,0 ,'black'); |
| 49 | +$graph->lineTo(2 ,3 ,'black'); |
| 50 | +#$graph->lineTo(1 ,1.5 ,'black'); |
| 51 | +#$graph->lineTo(1 ,3 ,'black'); |
| 52 | +#$graph->lineTo(0 ,3 ,'black'); |
| 53 | +$graph->moveTo(0,3); |
| 54 | +$graph->lineTo(0 ,1 ,'black'); |
| 55 | + |
| 56 | +$graph->moveTo(0,1); |
| 57 | +$graph->lineTo(2 ,1 ,'gray'); |
| 58 | +$graph->moveTo(-.2,1); |
| 59 | +$graph->lineTo(0,1 ,'gray'); |
| 60 | +$graph->moveTo(-.2,3); |
| 61 | +$graph->lineTo(0,3,'gray'); |
| 62 | +$graph->moveTo(-.1,1); |
| 63 | +$graph->lineTo(-.1,3,'gray'); |
| 64 | +#$graph->moveTo(0,-.1); |
| 65 | +#$graph->lineTo(2 ,-.1 ,'gray'); |
| 66 | +#$graph->moveTo(2,-.2); |
| 67 | +#$graph->lineTo(2 ,0 ,'gray'); |
| 68 | +#$graph->moveTo(0,0); |
| 69 | +#$graph->lineTo(0 ,-.2 ,'gray'); |
| 70 | +$graph->moveTo(2,0); |
| 71 | +$graph->lineTo(2.2,0 ,'gray'); |
| 72 | +$graph->moveTo(2.1,0); |
| 73 | +$graph->lineTo(2.1,3 ,'gray'); |
| 74 | +$graph->moveTo(2,3); |
| 75 | +$graph->lineTo(2.2,3 ,'gray'); |
| 76 | + |
| 77 | + |
| 78 | + $label1= new Label(-.5 , 2 , "$c ft" ,'black',('center','center')); |
| 79 | + $label1->font(GD::Font->Giant); |
| 80 | + $graph -> lb($label1); |
| 81 | + $label2= new Label(1 ,1.15 , "$a ft",'black',('center','center')); |
| 82 | + $label2->font(GD::Font->Giant); |
| 83 | + $graph -> lb($label2); |
| 84 | + $label3= new Label(2.5 ,1.5 , "$b ft",'black',('center','center')); |
| 85 | + $label3->font(GD::Font->Giant); |
| 86 | + $graph -> lb($label3); |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +########################################### |
| 92 | +BEGIN_TEXT |
| 93 | + |
| 94 | +$BR |
| 95 | +\{ image( insertGraph($graph), tex_size=>$TEXSIZE, |
| 96 | + height=>$HEIGHT, width=>$WIDTH |
| 97 | + ) \} |
| 98 | +$PAR |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | +$PAR |
| 105 | +What is the perimeter of the shape? Include units. $BR \{ans_rule(20)\} |
| 106 | +$PAR |
| 107 | +What is the area of the shape? Include units. $BR \{ans_rule(20)\} |
| 108 | +$PAR |
| 109 | +Note: The drawing is not to scale |
| 110 | +END_TEXT |
| 111 | +######################################### |
| 112 | +ANS(num_cmp($ans1, units=>'ft')); |
| 113 | +ANS(num_cmp($ans2, units=>'ft^2')); |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | +COMMENT('MathObject version'); |
| 120 | +ENDDOCUMENT(); |
| 121 | + |
0 commit comments