Randy Carspecken

20 Reputation

2 Badges

18 years, 55 days

MaplePrimes Activity


These are replies submitted by Randy Carspecken

Thanks Alex for answering my last question! Here's another: in trying to get a plot to graph a parallelogram slanting either left or right (left or right being a random choice) by reflecting it across the y-axis the expression $x1=$x1*$xrefl; in the code below confuses TA. The issue is doubtless a variable assignment that refers to itself. Any ideas to get around this? Is there an IF-THEN structure I can use in generating algorithmic variables? $x1=range(-6,-3); $y1=range(-6,-3); $horiz1=range(2,4); $horiz2=range(6,9); $vert=range(2,9); $x2=$x1+$horiz1; $y2=$y1+$vert; $x3=$x1+$horiz2; $y3=$y2; $x4=$x3-$horiz1; $y4=$y1; $xrefl=switch(rint(2),1,-1); $x1=$x1*$xrefl; ... ... ... $base=$horiz2-$horiz1; $ans=$base*$vert; $p=plotmaple("plots[display](plots[polygonplot]([[$x1,$y1],[$x2,$y2],[$x3,$y3],[$x4,$y4]], tickmarks = [[-7,-6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6,7], [-7,-6, -5, -4, -3, -2, 1, 2, 3, 4, 5, 6,7]],thickness=2), plots[coordplot](cartesian, grid = [21, 21],color = grey),view = [-7 .. 7, -7 .. 7], axes = normal)");
Thanks Alex for answering my last question! Here's another: in trying to get a plot to graph a parallelogram slanting either left or right (left or right being a random choice) by reflecting it across the y-axis the expression $x1=$x1*$xrefl; in the code below confuses TA. The issue is doubtless a variable assignment that refers to itself. Any ideas to get around this? Is there an IF-THEN structure I can use in generating algorithmic variables? $x1=range(-6,-3); $y1=range(-6,-3); $horiz1=range(2,4); $horiz2=range(6,9); $vert=range(2,9); $x2=$x1+$horiz1; $y2=$y1+$vert; $x3=$x1+$horiz2; $y3=$y2; $x4=$x3-$horiz1; $y4=$y1; $xrefl=switch(rint(2),1,-1); $x1=$x1*$xrefl; ... ... ... $base=$horiz2-$horiz1; $ans=$base*$vert; $p=plotmaple("plots[display](plots[polygonplot]([[$x1,$y1],[$x2,$y2],[$x3,$y3],[$x4,$y4]], tickmarks = [[-7,-6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6,7], [-7,-6, -5, -4, -3, -2, 1, 2, 3, 4, 5, 6,7]],thickness=2), plots[coordplot](cartesian, grid = [21, 21],color = grey),view = [-7 .. 7, -7 .. 7], axes = normal)");
Currently I am using TA version 2.51. Our school just purchased a 1-year trial of TA 3.0 so I should soon be upgrading. Meanwhile you could save me some time with instruction on how to combine both a "pointplot" and a function graph one one set of axes.
Currently I am using TA version 2.51. Our school just purchased a 1-year trial of TA 3.0 so I should soon be upgrading. Meanwhile you could save me some time with instruction on how to combine both a "pointplot" and a function graph one one set of axes.
Page 1 of 1