# How to have students see everyone's line overlaid on a curve

**URL:** <https://cl.desmos.com/t/how-to-have-students-see-everyones-line-overlaid-on-a-curve/7764>\
**Category:** Questions\
**Tags:** sketch, aggregate\
**Created:** [February 20, 2025, 6:22pm UTC](https://cl.desmos.com/t/how-to-have-students-see-everyones-line-overlaid-on-a-curve/7764 "2025-02-20T18:22:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackson\_schumacher](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jackson_schumacher/32/6697_2.png) [@jackson\_schumacher](https://cl.desmos.com/u/jackson_schumacher)\
**Post date:** [February 20, 2025, 6:22pm UTC](https://cl.desmos.com/t/how-to-have-students-see-everyones-line-overlaid-on-a-curve/7764/1 "2025-02-20T18:22:11Z")

</div>

Hi I am very new to creating desmos activities and my goal is to give students a curve and have students drag lines to make them tangent to the curve, and when they do that and submit it, they will see all of the lines.

I can make the lines draggable and which is what I want but I want students to see each others work.If this can be done with an overlay somehow, or have students all work on the same graph. Or maybe I use the sketch tool, how it is done is not important but I just want students to see all of the lines they have created.

Now I might be a little over my head so is there any good youtube resources to help me get started and understanding the coding aspect to this activity builder?

---

<div class="post-metadata">

**Author:** ![Mike\_Gleeson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mike_gleeson/32/650_2.png) [@Mike\_Gleeson](https://cl.desmos.com/u/Mike_Gleeson)\
**Post date:** [February 21, 2025, 11:33pm UTC](https://cl.desmos.com/t/how-to-have-students-see-everyones-line-overlaid-on-a-curve/7764/2 "2025-02-21T23:33:49Z")

</div>

Have a look at [`aggregate`](https://teacher.desmos.com/computation-layer/documentation#aggregate), it might help you do this

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [February 22, 2025, 5:19pm UTC](https://cl.desmos.com/t/how-to-have-students-see-everyones-line-overlaid-on-a-curve/7764/3 "2025-02-22T17:19:02Z")

</div>

Gets a little tricky trying to handle vertical lines, but here’s one way of approaching it. Currently the first screen has both editing and aggregating, but I’d recommend students edit on one screen and look at the aggregated on another, as it may lag a little while it live updates.

Since `aggregate` can only aggregate single values, you have to create multiple lists to define your lines. I could’ve created four lists, one for each coordinate, but that’s twice as much data compared to using slope and intercept. Doing that I did a little trickery to identify vertical lines.

> **[Examples for Forum 2 • Activity Builder by Desmos Classroom](https://teacher.desmos.com/activitybuilder/custom/677415872f44f41f5debc1e3#preview/4db12515-a278-452d-9707-111fdc00a06f)**
>
> by Daniel Grubbs

---

<div class="post-metadata">

**Author:** ![Mike\_Gleeson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mike_gleeson/32/650_2.png) [@Mike\_Gleeson](https://cl.desmos.com/u/Mike_Gleeson)\
**Post date:** [February 24, 2025, 2:46am UTC](https://cl.desmos.com/t/how-to-have-students-see-everyones-line-overlaid-on-a-curve/7764/4 "2025-02-24T02:46:42Z")

</div>

you gotta be really careful with this. i’ve found aggregate to have a lot of trouble syncing lists in a one-to-one fashion index-wise. it doesn’t seem able to keep up with the correct order all the time.

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [February 24, 2025, 1:43pm UTC](https://cl.desmos.com/t/how-to-have-students-see-everyones-line-overlaid-on-a-curve/7764/5 "2025-02-24T13:43:44Z")

</div>

> [@Mike\_Gleeson](#):
>
> i’ve found aggregate to have a lot of trouble syncing lists

Agreed. Too many values gets difficult to handle. Were it just integers, you could stitch them together into a single value to aggregate, then split them back apart, so you’re only collecting one list. You’ll have a little more load on the graph, but won’t have errors syncing lists.

```auto
g = graphName
maxDigits = 2
fStitch = simpleFunction(`10^{${maxDigits}}*a + b`, `a`, `b`)
number(`J_{oined}`): aggregate(fStitch.evaluate(g.number(`m`), g.number(`b`)))
-------
In the actual graph:
M_{List} = \floor(J_{oined}/100)
B_{List} = J_{oined} - M_{List}

```
