Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions source/precalculus/exercises/bank.xml
Original file line number Diff line number Diff line change
Expand Up @@ -436,15 +436,14 @@
Use the law of sines and/or the law of cosines to solve non-right triangles.
</description>
</outcome>
<!--
<outcome>
<title>Applications of Trigonometry</title>
<slug>TE6</slug>
<path>outcomes/TE/TE6</path>
<description>
Solve applications that require the use of trigonometry to find a side or angle.
</description>
</outcome> -->
</outcome>

</outcomes>
</bank>
213 changes: 213 additions & 0 deletions source/precalculus/exercises/outcomes/TE/TE6/generator.sage
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
load("../../../source/common/sagemath/library.sage")
class Generator(BaseGenerator):
def data(self):

names=["Mateo", "Nina", "Ophelia", "Pierre", "Quinn", "Rosa", "Serena", "Thad", "Ursula","Victor"]

scenario1=choice(["ladder","elevation","angleofclimb","fire","scuba"])
#Ladder against a building
if scenario1=="ladder":
ladder_length=choice([12,16,..,48])
#Keep it 60-80 degrees ish
height = choice([int(sin(pi/3)*ladder_length),..,int(sin(80/180*pi)*ladder_length)])
angle = round(arcsin(height/ladder_length)*180/pi,1)
variables1 = { "height": height,
"ladder": ladder_length,
"angle": angle
}
#Angle of elevation/depression
elif scenario1=="elevation":
scenario=choice(["scenarioA","scenarioB"])
units=choice(["ft","m"])
if units=="ft":
height=choice([500,600,..,4000])
else:
height=choice([100,150,..,1000])
angle = choice([10..35])
distance=round(height/sin(angle*pi/180),0)
variables1={ scenario: {
"name": choice(names),
"units": units,
"height": height,
"angle": angle,
"distance": distance,
}
}
#Airplane climbing
elif scenario1=="angleofclimb":
angle = choice([12..20])
height= choice([5000,6000,..,20000])
distance=round(height/tan(angle*pi/180),0)
variables1={ "height": height,
"angle": angle,
"distance": distance,
"distance_miles": round(distance/5280,0),
}
elif scenario1=="fire":
angles=sample([40..70],2)
angles.sort()
angle3 = 180-angles[0]-angles[1]
distance=choice([10..40])
d=round(sin(angles[0]*pi/180)/sin(angle3*pi/180)*distance,1)

rangers=sample(["Arata", "Botha", "Chang", "Dinh", "Emerson", "Fabian", "Hernandez", "Ishikawa",
"Jones", "Khoury", "Lee", "Martinez", "Naser", "Okpara", "Rodriguez",
"Shalhoub", "Thomas", "Williams", "Zhang"],2)
ranger_answer=rangers[1]
if choice([True,False]):
angles.reverse()
rangers.reverse()

directions=["left","right"]
shuffle(directions)

variables1 = {
"park": choice(["Yosemite National Park", "the Sierra National Forest",
"Sequoia National Park", "Kings Canyon National Park",
"the Stanislaus National Forest", "the Tahoe National Forest",
"Pinnacles National Park", "the Inyo National Forest",
"the Sequoia National Forest"]),
"distance": distance,
"angle1": angles[0],
"angle2": angles[1],
"ranger1": rangers[0],
"ranger2": rangers[1],
"direction1": directions[0],
"direction2": directions[1],
"answer": d,
"ranger_answer": ranger_answer,
}
elif scenario1=="scuba":
angles=sample([40..70],2)
#angles.sort()
angle3 = 180-angles[0]-angles[1]
distance=choice([10..40])
d1=round(sin(angles[1]*pi/180)/sin(angle3*pi/180)*distance,1)
d2=round(sin(angles[0]*pi/180)/sin(angle3*pi/180)*distance,1)

names=sample([
"Astera", "Alexi",
"Boudica", "Byron",
"Claudette", "Carlos",
"Devonta", "Deborah",
"Evie", "Envita",
"Federico", "Frankie",
"Greny", "Greta",
"Hani", "Harlin",
"Inigo", "Imogene",
"Jun Young", "Jarvis",
"Khalil", "Kiara",
"Lisandro","Leslie",
"Marcelo", "Melissa",
"Nicolas", "Nicole",
"Pedro", "Pham",
"Raquel", "Rodrigo" ],2)

variables1 = {
"depth": choice([5..25]),
"animal": choice(["leopard shark", "green moray", "manta ray", "sea turtle"]),
"distance": distance,
"angle1": angles[0],
"angle2": angles[1],
"name1": names[0],
"name2": names[1],
"distance1": d1,
"distance2": d2,
}





scenario2=choice(["airport","hiker","boats","ceiling","carpentersquare","bridge"])
#SAS, Law of cosines
if scenario2=="airport":
plane1,plane2=sample([" Boeing 737", " Boeing 747", " Boeing 767", "n Airbus A320", "n Airbus A330",
" McDonnel Douglas MD11", " Bombardier CRJ200", "n Embraer E170"],2)
d1,d2=sample([10..75],2)
heading1,heading2=sample([10,20,..,350],2)
distance=round(sqrt(d1^2+d2^2-2*d1*d2*cos(abs(heading1-heading2)*pi/180)),1)
variables2={ "plane1": plane1,
"plane2": plane2,
"distance1": d1,
"distance2": d2,
"heading1": heading1,
"heading2": heading2,
"distance3": distance,
"units": choice(["miles","kilometers"])
}
elif scenario2=="hiker":
d1,d2=sample([2..10],2)
angle=choice([20,25,..,80]+[100,105..,140])
distance=round(sqrt(d1^2+d2^2-2*d1*d2*cos(pi-angle*pi/180)),1)
variables2={ "distance1": d1,
"distance2": d2,
"angle": angle,
"direction": choice(["left","right"]),
"distance3": distance,
"units": choice(["miles","kilometers"])
}
##AAS Law of sines
elif scenario2=="boats":
angle1,angle2=sample([5,10,..,75],2)
d1=choice([10..50])
d2=round(d1*sin(angle2*pi/180)/sin(angle1*pi/180),1)
d3=round(d1*sin((180-angle1-angle2)*pi/180)/sin(angle1*pi/180),1)
variables2={ "angle1": angle1,
"angle2": angle2,
"distance1": d1,
"distance2": d2,
"distance3": d3,
"specifier": choice(["taller", "newer", "red"]),
"units": choice(["nautical miles", "miles", "kilometers"])
}
elif scenario2=="ceiling":
angle=choice([85,..,89]+[91..95])
d=round(choice([2,2.25,..,5]),2)
units=choice(["inches","centimeters"])
if units=="centimeters":
d=2*d
e=round(d*sin(angle*pi/180)/sin((pi-angle*pi/180)/2),2)
variables2={ "angle": angle,
"distance1": d,
"distance2": e,
"units": units,
}
#SSS
elif scenario2=="carpentersquare":
angle=choice([85,..,89]+[91..95])
d1,d2=sample([4,4.5,..,20],2)
d3=round(sqrt(d1^2+d2^2-2*d1*d2*cos(angle*pi/180)),1)
angle=round(arccos((d3^2-d1^2-d2^2)/(-2*d1*d2))*180/pi,1)
units=choice(["inches","centimeters"])
if units=="centimeters":
d1,d2,d3=(2*d1,2*d2,2*d3)
variables2={ "angle": angle,
"distance1": round(d1,1),
"distance2": round(d2,1),
"distance3": d3,
"units": units,
}
elif scenario2=="bridge":
d=sample([50..100],3)
angle_choice = choice(["smallest","largest"])
if angle_choice=="smallest":
d.sort()
else:
d.sort(reverse=True)

angle=round(arccos((d[0]^2-d[1]^2-d[2]^2)/(-2*d[1]*d[2]))*180/pi,1)
shuffle(d)
variables2={
"d1": d[0],
"d2": d[1],
"d3": d[2],
"angle_choice": angle_choice,
"angle": angle,
"units": choice(["feet", "meters"])
}


tasks=[ {scenario1: {**variables1}}, {scenario2: {**variables2}}]
shuffle(tasks)
return { "tasks": tasks }
148 changes: 148 additions & 0 deletions source/precalculus/exercises/outcomes/TE/TE6/template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<knowl mode="exercise" xmlns="https://spatext.clontz.org" version="0.2">
<!--{{#tasks}}-->
<knowl>
<!-- First task options -->
<!--{{#ladder}}-->
<content>
<p>A <m>{{ladder}}\ \text{ft}</m> ladder is leaned against a wall that is
<m>{{height}}\ \text{ft}</m> tall. What angle does the ladder make with the ground?</p>
</content>
<outtro>
<p><m>{{angle}}^\circ</m></p>
</outtro>
<!--{{/ladder}}-->
<!--{{#elevation}}-->
<!--{{#scenarioA}}-->
<content>
<p>{{name}} is standing on top of a cliff <m>{{height}}</m> {{units}} above a lake.
They see a boat on the lake, and measure an angle of depression from the horizon
to the boat of <m>{{angle}}^\circ</m>. How far away from {{name}} is the boat?
</p>
</content>
<outtro>
<p><m>{{distance}}</m> {{units}}</p>
</outtro>
<!--{{/scenarioA}}-->
<!--{{#scenarioB}}-->
<content>
<p>{{name}} sees a person on top of a <m>{{height}}</m> {{units}} tall cliff.
They measure an angle of elevation from the ground to the person of <m>{{angle}}^\circ</m>.
How far away from {{name}} is the other person?
</p>
</content>
<outtro>
<p><m>{{distance}}</m> {{units}}</p>
</outtro>
<!--{{/scenarioB}}-->
<!--{{/elevation}}-->
<!--{{#angleofclimb}}-->
<content>
<p>An airplane takes off from a runway and climbs at angle of <m>{{angle}}^\circ</m>.
How far along the ground does the plane need to travel to reach an altitude of
<m>{{height}}\ \text{ft}</m>?
</p>
</content>
<outtro>
<p><m>{{distance}}\ \text{ft}</m>, or about <m>{{distance_miles}}</m> miles</p>
</outtro>
<!--{{/angleofclimb}}-->
<!--{{#fire}}-->
<content>
<p>In {{park}}, two fire towers are located <m>{{distance}}</m> miles apart. Ranger {{ranger1}}
is in one tower, and measures that the fire is <m>{{angle1}}^\circ</m> to the {{direction1}} of
the other tower. Ranger {{ranger2}} is in the other tower, and measures that the fire is
<m>{{angle2}}^\circ</m> to the {{direction2}} of the first tower. Which ranger is closer to the
fire, and how far away are they from the fire?
</p>
</content>
<outtro>
<p>Ranger {{ranger_answer}} is <m>{{answer}}</m> miles from the fire. </p>
</outtro>
<!--{{/fire}}-->
<!--{{#scuba}}-->
<content>
<p>{{name1}} and {{name2}} are scuba diving and are <m>{{depth}}</m> meters below the surface of the water,
and are horizontally <m>{{distance}}</m> meters apart.
They spot a {{animal}} swimming below them. The angle of depression from {{name1}} to the {{animal}} is
<m>{{angle1}}^\circ</m> and the angle of depression from {{name2}} to the {{animal}} is <m>{{angle2}}^\circ</m>.
How far is each diver from the {{animal}}?
</p>
</content>
<outtro>
<p>{{name1}} is <m>{{distance1}}</m> meters away and {{name2}} is <m>{{distance2}}</m> meters away. </p>
</outtro>
<!--{{/scuba}}-->
<!-- Second task options -->
<!--{{#airport}}-->
<content>
<p>A{{plane1}} is heading directly away from an airport on a heading of <m>{{heading1}}^\circ</m>,
and is <m>{{distance1}}</m> {{units}} away from the airport.
The pilot hears over the radio that there is a{{plane2}} flying at a heading of <m>{{heading2}}^\circ</m>
that is currently <m>{{distance2}}</m> {{units}} from the airport.
How far apart are the two planes?
</p>
</content>
<outtro>
<p><m>{{distance3}}</m> {{units}}</p>
</outtro>
<!--{{/airport}}-->
<!--{{#ceiling}}-->
<content>
<p>In a particular room, the ceiling meets the wall at a <m>{{angle}}^\circ</m>angle. A trim carpenter wants
to fit a piece of crown moulding that meets the ceiling and the wall both <m>{{distance1}}</m> {{units}} from the corner.
How wide should this piece of crown moulding be?
</p>
</content>
<outtro>
<p><m>{{distance2}}</m> {{units}}</p>
</outtro>
<!--{{/ceiling}}-->
<!--{{#hiker}}-->
<content>
<p>A hiker walks in a straight line for <m>{{distance1}}</m> {{units}}. They turn <m>{{angle}}^\circ</m>
to their {{direction}} and walk another <m>{{distance2}}</m> {{units}}. If they then want to walk
in a straight line back to their starting place, how far must they walk?
</p>
</content>
<outtro>
<p><m>{{distance3}}</m> {{units}}</p>
</outtro>
<!--{{/hiker}}-->
<!--{{#boats}}-->
<content>
<p>A boat is lost, but sees two lighthouses on the shore. The boat measures an angle of <m>{{angle1}}^\circ</m>
between the two lighthouses, and fortunately establishes radio contact with a person in the {{specifier}} lighthouse.
They report that the lighthouses are <m>{{distance1}}</m> {{units}} apart, and they see an angle of
<m>{{angle2}}^\circ</m> between the boat and the other lighthouse. How far is the boat from each lighthouse?
</p>
</content>
<outtro>
<p><m>{{distance3}}</m> {{units}} from the {{specifier}} lighthouse, and <m>{{distance2}}</m> {{units}} from the other lighthouse.</p>
</outtro>
<!--{{/boats}}-->
<!--{{#carpentersquare}}-->
<content>
<p>A carpenter is trying to determine if two pieces of wood meet at a right angle, and does not have a square.
One piece of wood is <m>{{distance1}}</m> {{units}} long, and the other is <m>{{distance2}}</m> {{units}} long.
She measures the distance between the other ends of the pieces of wood as <m>{{distance3}}</m> {{units}}.
What angle do the two pieces of wood make with each other?
</p>
</content>
<outtro>
<p><m>{{angle}}^\circ</m></p>
</outtro>
<!--{{/carpentersquare}}-->
<!--{{#bridge}}-->
<content>
<p>A bridge is supported by triangular braces. If the sides of each brace have lengths
<m>{{d1}}</m> {{units}}, <m>{{d2}}</m> {{units}}, and <m>{{d3}}</m> {{units}}, find the
measure of the {{angle_choice}} angle created by the sides of the brace.
</p>
</content>
<outtro>
<p><m>{{angle}}^\circ</m></p>
</outtro>
<!--{{/bridge}}-->
</knowl>
<!--{{/tasks}}-->
</knowl>