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
12 changes: 6 additions & 6 deletions source/linear-algebra/source/01-LE/01.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -508,15 +508,15 @@ system). Otherwise it is <term>inconsistent</term>.<idx><h>inconsistent linear s

<figure xml:id="figure-intersecting-planes-one">
<caption>Intersection of three planes at one point</caption>
<image xml:id="LE1-image-intersection-planes-one" width="50%" component="print">
<image xml:id="LE1-image-intersection-planes-one-print" width="50%" component="print">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./sage/LE1-image-intersection-planes-one.sage" parse="text"/>
</sageplot>
<description>
<p>Three planes are shown to intersect at a single point. An arrow points to the point of intersection at coordinates <m>(1,2,3)</m>.</p>
</description>
</image>
<image xml:id="LE1-image-intersection-planes-one" component="html">
<image xml:id="LE1-image-intersection-planes-one-html" component="html">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./sage/LE1-image-intersection-planes-one.sage" parse="text"/>
</sageplot>
Expand All @@ -528,15 +528,15 @@ system). Otherwise it is <term>inconsistent</term>.<idx><h>inconsistent linear s

<figure xml:id="figure-intersecting-planes-inf">
<caption>Intersection of three planes at a line</caption>
<image xml:id="LE1-image-intersection-planes-inf" width="50%" component="print">
<image xml:id="LE1-image-intersection-planes-inf-print" width="50%" component="print">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./sage/LE1-image-intersection-planes-inf.sage" parse="text"/>
</sageplot>
<description>
<p>Three planes are shown to intersect along a line of points.</p>
</description>
</image>
<image xml:id="LE1-image-intersection-planes-inf" component="html">
<image xml:id="LE1-image-intersection-planes-inf-html" component="html">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./sage/LE1-image-intersection-planes-inf.sage" parse="text"/>
</sageplot>
Expand All @@ -548,15 +548,15 @@ system). Otherwise it is <term>inconsistent</term>.<idx><h>inconsistent linear s

<figure xml:id="figure-intersecting-planes-zero">
<caption>Three non-mutually-intersecting planes</caption>
<image xml:id="LE1-image-intersection-planes-zero" width="50%" component="print">
<image xml:id="LE1-image-intersection-planes-zero-print" width="50%" component="print">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./sage/LE1-image-intersection-planes-zero.sage" parse="text"/>
</sageplot>
<description>
<p>Three planes are shown to intersect at no common point, although each pair of planes intersects along a line of points.</p>
</description>
</image>
<image xml:id="LE1-image-intersection-planes-zero" component="html">
<image xml:id="LE1-image-intersection-planes-zero-html" component="html">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./sage/LE1-image-intersection-planes-zero.sage" parse="text"/>
</sageplot>
Expand Down
80 changes: 49 additions & 31 deletions source/linear-algebra/source/02-EV/01.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -221,27 +221,26 @@ we refer to this real number as a <term>scalar</term>.
</p>
</task>
<task>
<p component="html">
Correct the SageMath code cell below to generate
an illustration of several vectors belonging to
<me>\vspan\left\{\left[\begin{array}{c}1\\2\end{array}\right],
\left[\begin{array}{c}-1\\1\end{array}\right]\right\}=
\setBuilder{a\left[\begin{array}{c}1\\2\end{array}\right]+
b\left[\begin{array}{c}-1\\1\end{array}\right]}{a, b \in \IR}</me>
in the <m>xy</m> plane.
</p>
<sage component="html">
<input>
<xi:include href="./code/ev1-planar-span.sage" parse="text" />
</input>
</sage>
<p component="html">
Based on this illustration, which of these geometrical objects
best describes the span of these two vectors?
<p>
In addition to the combinations above, use the interactive below to graph an additional
5 or more vectors belonging to
<me>\vspan\left\{\left[\begin{array}{c}1\\2\end{array}\right],
\left[\begin{array}{c}-1\\1\end{array}\right]\right\}=
\setBuilder{a\left[\begin{array}{c}1\\2\end{array}\right]+
b\left[\begin{array}{c}-1\\1\end{array}\right]}{a, b \in \IR}</me>
in the <m>xy</m> plane.
</p>
<p component="print">
Which of these geometrical objects
best describes the span of these two vectors?
<interactive label="EV1-interactive-span" platform="doenetml" width="100%">
<slate surface="doenetml">
<xi:include parse="text" href="doenet/EV1-span-two-vectors.xml"/>
</slate>
<description>
<p>An interactive that graphs linear combinations of the vectors <m>\left[\begin{array}{c}1\\2\end{array}\right]</m> and
<m> \left[\begin{array}{c}-1\\1\end{array}\right]</m>.</p>
</description>
</interactive>
<p>
Which of these geometrical objects best describes the span of these two vectors?
</p>
<ol marker="A." cols="4">
<li>A line</li>
Expand Down Expand Up @@ -525,15 +524,15 @@ It is important to remember that
</p>
<p>
For example,
<me>
<me>S=
\setList
{
\left[\begin{array}{c} 1 \\ -1 \\ 2 \end{array}\right],
\left[\begin{array}{c} 1 \\ 2 \\ 1 \end{array}\right]
}
</me>
is a set containing exactly two vectors, while
<me>
<me>\vspan S =
\vspan\setList
{
\left[\begin{array}{c} 1 \\ -1 \\ 2 \end{array}\right],
Expand All @@ -546,15 +545,34 @@ b\left[\begin{array}{c} 1 \\ 2 \\ 1 \end{array}\right]
a,b\in\IR
}
</me>
is a set containing infinitely-many vectors. </p>
<p component="html">See the below
Sage cell for an illustration.
</p>
<sage language="sage" component="html">
<input>
<xi:include href="./code/ev1-remark-span.sage" parse="text" />
</input>
</sage>
is a set containing infinitely-many vectors.
</p>
<figure>
<sidebyside widths="45% 45%">
<image>
<sageplot variant="3d" aspect="1.0">
<xi:include href="./code/ev1-remark-span1.sage" parse="text" />
</sageplot>
<description><p>An interactive 3-D plot showing the two vectors in <m>S</m></p></description>
</image>
<image>
<sageplot variant="3d" aspect="1.0">
<xi:include href="./code/ev1-remark-span2.sage" parse="text" />
</sageplot>
<description><p>An interactive 3-D plot showing the vectors in <m>\vspan S</m></p></description>
</image>
</sidebyside>
<caption>
<p component="html">
Two interactive 3-D plots showing the two vectors in <m>S</m> on the
left and <m>\vspan S</m> on the right.
</p>
<p component="print">
Two plots showing the two vectors in <m>S</m> on the
left and <m>\vspan S</m> on the right.
</p>
</caption>
</figure>
</remark>

</subsection>
Expand Down
34 changes: 12 additions & 22 deletions source/linear-algebra/source/02-EV/02.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -262,31 +262,21 @@ The vector does not belong to the span.
</p>
</answer>
</task>
<task component="html">
<statement>
<p>
Fix the SageMath code below to visualize
</activity>
<observation>
<p>We can use technology to visualize
<m>\vspan\left\{\left[\begin{array}{c}1\\-1\\0\end{array}\right],
\left[\begin{array}{c}-2\\0\\1\end{array}\right],\left[\begin{array}{c}-2\\-2\\2\end{array}\right]\right\}</m>.
</p>
<sage>
<input>
</p>
<image width="70%">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./code/ev2-span-visual.sage" parse="text" />
</input>
</sage>
</statement>
<answer>
<program language="sage">
<code>
v2 = vector([-2,0,1])
v3 = vector([-2,-2,2])
# ...
linear_combo = a*v1 + b*v2 + c*v3
</code>
</program>
</answer>
</task>
</activity>
</sageplot>
<description><p>An interactive 3-D plot showing the span</p></description>
</image>
<p component="html">Rotate the plot to see that the vectors all lie in the same plane.</p>
<p component="print">Note that the vectors all lie in the same plane.</p>
</observation>
<activity>
<introduction>
<p>
Expand Down
9 changes: 9 additions & 0 deletions source/linear-algebra/source/02-EV/code/ev1-remark-span1.sage
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
v1 = vector([1,-1,2])
v2 = vector([1,2,1])

# illustrate set of two vectors

p = plot(v1,thickness=5)
p += plot(v2,thickness=5)
p=p.rotate([1,0,0],3*pi/4)
p
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
v1 = vector([1,-1,2])
v2 = vector([1,2,1])

# illustrate set of two vectors

p = plot(v1)
p += plot(v2)
show(p)

# illustrate the *span* that set
# illustrate the *span*

p = plot([])
for _ in range(1000):
a = randrange(-99,100)
b = randrange(-99,100)
p += plot(a*v1+b*v2)
show(p)
p += plot(a*v1+b*v2, thickness=15)
p=p.rotate([1,0,0],3*pi/4)
p
10 changes: 5 additions & 5 deletions source/linear-algebra/source/02-EV/code/ev2-span-visual.sage
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ p = plot([])

# define three vectors
v1 = vector([1,-1,0])
v2 = vector(FIXME)
v3 = vector(FIXME)
v2 = vector([-2,0,1])
v3 = vector([-2,-2,2])

# do this 100 times
for _ in range(100):
Expand All @@ -13,9 +13,9 @@ for _ in range(100):
b = randrange(-9,10)
c = randrange(-9,10)
# create linear combination
linear_combo = a*v1 + b*v2 + FIXME
linear_combo = a*v1 + b*v2 + c*v3
# add it to the plot
p += plot(linear_combo)
p += plot(linear_combo,thickness=2)

# show the plot
show(p)
p
59 changes: 59 additions & 0 deletions source/linear-algebra/source/02-EV/doenet/EV1-span-two-vectors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<p>
Enter several pairs of coefficients <m>(a,b)</m>, separated by commas:
<mathInput name="in" minwidth="500" prefill="(1,1),(-2,1),(-1,-2)" />
</p>

<setup>
<math name="v"> (1,2)</math>
<math name="w"> (-1,1)</math>
<mathList name="l">$in</mathList>
<sampleRandomNumbers numSamples="10" from="-6" to="6" name="a" asList="true"/>
<sampleRandomNumbers numSamples="10" from="-6" to="6" name="b" asList="true"/>
</setup>

<triggerSet>
<!--<callAction actionName="deleteChildren" target="$g" number="1000"/>-->
<callAction actionName="addChildren" target="$g">
<vector draggable="false" styleNumber="1" head="$v" />
<label anchor="$v" positionFromAnchor="right">
<m>\left[\begin{array}{c} $v.x \\ $v.y\end{array}\right]</m>
</label>
<vector draggable="false" styleNumber="2" head="$w" />
<label anchor="$w" positionFromAnchor="left">
<m>\left[\begin{array}{c} $w.x \\ $w.y\end{array}\right]</m>
</label>
<repeat for="$l" valueName="c">
<vector draggable="false" styleNumber="3" head="$c.x*$v+$c.y*$w"/>
</repeat>
</callAction>

<label>Plot the above linear combinations</label>
</triggerSet>

<callAction actionName="deleteChildren" target="$g" number="1000"><label>Reset plot</label></callAction>

<triggerSet>
<label>Add 10 random linear combinations</label>

<callAction target="$a" actionName="resample"/>
<callAction target="$b" actionName="resample"/>
<callAction actionName="addChildren" target="$g">
<repeatForSequence from="0" to="10" step="1" valueName="i">
<vector draggable="false" styleNumber="4" head="$a[$i]*$v+$b[$i]*$w"/>
</repeatForSequence>
</callAction>
</triggerSet>

<graph name="g" xmin="-10" ymin="-10" xmax="10" ymax="10">
<description>Graph of two vectors and linear combinations thereof</description>

<vector draggable="false" styleNumber="1" head="$v" />
<label anchor="$v" positionFromAnchor="right">
<m>\left[\begin{array}{c} $v.x \\ $v.y\end{array}\right]</m>
</label>
<vector draggable="false" styleNumber="2" head="$w" />
<label anchor="$w" positionFromAnchor="left">
<m>\left[\begin{array}{c} $w.x \\ $w.y\end{array}\right]</m>
</label>

</graph>
Loading