Hi, Paul,

I'm not sure this is what you had in mind, but PCC has problems with labeled dynamic triangles. Look in the Library: Subject:"Trigonometry", Chapter:"Triangle trigonometry", Section:"Sine, cosine, and tangent of an angle in a right triangle".

We've done a few at the College of Idaho, but the angles have to be not too small. They are not yet in the OPL--perhaps this summer, I'll work on tagging. Also, greek letters don't seem to be available. PCC uses the letters spelled out. Here's the code for one of ours.

--rac

========================================

##DESCRIPTION

## Trigonometry: Law of Sines

##ENDDESCRIPTION

##KEYWORDS('trigonometry', 'law of sines')

## DBsubject('Trigonometry')

## DBchapter('')

## DBsection('')

## Date('01/2016')

## Author('RA Cruz')

## Institution('The College of Idaho')

## TitleText1('')

## EditionText1('')

## AuthorText1('')

## Section1('')

## Problem1('')

DOCUMENT(); # This should be the first executable line in the problem.

loadMacros(

"PGstandard.pl",

"MathObjects.pl",

"PGchoicemacros.pl",

"PGgraphmacros.pl",

"alignedChoice.pl",

"unionTables.pl",

);

######################################

# Set-up

$a = random(4,9,1);

$A = random(25,40,5);

$C = random(70,85,5);

$B = 180 - $A - $C;

$c = $a*sin($C*pi/180)/sin($A*pi/180);

$b = $a*sin($B*pi/180)/sin($A*pi/180);

$xc = $b*cos($A*pi/180); #C is at the top of the triangle

$yc = $b*sin($A*pi/180);

$Hmin = -2;

$Hmax = $c + 2;

$Vmin = -2;

$Vmax = $yc + 2;

$picW = 15*($Hmax-$Hmin+2);

$picH = 15*($Vmax-$Vmin+2);

$refreshCachedImages=1;

$graph = init_graph($Hmin,$Vmin,$Hmax,$Vmax,size=>[$picW,$picH]);

$graph->moveTo(0,0); #A is at the origin

$graph->lineTo($xc,$yc,1); #Draw to C

$graph->lineTo($c,0,1); #Draw to B to the right

$graph->lineTo(0,0,1);

#$graph->fillRegion([2,1,'yellow']);

$lab_a = new Label($xc+0.7*($c-$xc),0.5*$yc+0.2,"$a",'black','center','bottom');

$lab_a->font(GD::Font->Giant);

$graph->lb($lab_a);

$lab_b = new Label(0.5*$xc,0.5*$yc+0.2,"b",'red','center','bottom');

$lab_b->font(GD::Font->Giant);

$graph->lb($lab_b);

$lab_c = new Label(0.5*$c,-0.3,"c",'red','center','center');

$lab_c->font(GD::Font->Giant);

$graph->lb($lab_c);

$labA=new Label(-0.5,0.5,'A','black','center','center');

$labA->font(GD::Font->Giant);

$graph->lb($labA);

$labAdeg=new Label(0.2*$c,1,"$A",'black','center','center');

$labAdeg->font(GD::Font->Giant);

$graph->lb($labAdeg);

$labB=new Label($c+0.5, 0.5,'B','red','center','center');

$labB->font(GD::Font->Giant);

$graph->lb($labB);

$labC=new Label($xc,$yc+1,'C','black','center','center');

$labC->font(GD::Font->Giant);

$graph->lb($labC);

$labCdeg=new Label($xc-.1,0.85*$yc,"$C",'black','center','center');

$labCdeg->font(GD::Font->Giant);

$graph->lb($labCdeg);

######################################

# Main text

TEXT(beginproblem());

#TEXT("a = $a, b = $b, c =$c, B = $B $BR"); #For checking

BEGIN_TEXT

Solve for the unknown sides and angles of the triangle shown below.

Give the angle(s) in degrees.

$BR $BR

\{

ColumnTable(

"\(b = \) ".ans_rule(6).

"$BR $BR".

"\(c = \) ".ans_rule(6).

"$BR $BR".

"\(\angle B = \) ".ans_rule(6)."\(^\circ\)",

$BCENTER.

image(insertGraph($graph), width=>$picW, height=>$picH, tex_size=>500 ).

$BR.

$ECENTER,

indent => 0, separation => 30, valign => "TOP"

)

\}

$BR

$BITALIC

Note: If no such triangle exists, type ${BBOLD}No triangle$EBOLD for each answer.

$EITALIC

END_TEXT

######################################

# Answer

Context("Numeric");

Context()->strings->add("No triangle"=>{},None=>{alias=>"No triangle"});

$ans1 = Compute("$b");

ANS($ans1->cmp(showTypeWarnings=>0));

$ans2 = Compute("$c");

ANS($ans2->cmp(showTypeWarnings=>0));

$ans3 = Compute("$B");

ANS($ans3->cmp(showTypeWarnings=>0));

$showPartialCorrectAnswers = 1;

#####################################

# Solution

BEGIN_SOLUTION

$PAR Solution: $BR $BR

We need the angle at \(B:\)

\(\angle B = 180^{\circ} - $A^{\circ} - $C^{\circ} = $ans3^{\circ}\)

$BR $BR

Use the Law of Sines to find \(a\) and \(c\):

$BR $BR

First we find \(a\):

\(\dfrac{a}{\sin($A^{\circ})} = \dfrac{$b}{\sin($B^{\circ})} \\)

$BR

\(a = \dfrac{$b\sin($A^{\circ})}{\sin($B^{\circ})} \approx $ans1\)

$BR $BR

Similarily, find \(c\):

\(\dfrac{c}{\sin($C^{\circ})} = \dfrac{$b}{\sin($B^{\circ})} \\)

$BR

\(c = \dfrac{$b\sin($C^{\circ})}{\sin($B^{\circ})} \approx $ans2\)

END_SOLUTION

ENDDOCUMENT();