# Take 2: Transfer slope to graph from table input

**URL:** <https://cl.desmos.com/t/take-2-transfer-slope-to-graph-from-table-input/4831>\
**Category:** Questions\
**Created:** [April 10, 2023, 6:19pm UTC](https://cl.desmos.com/t/take-2-transfer-slope-to-graph-from-table-input/4831 "2023-04-10T18:19:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jared\_Schulz](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jared_schulz/32/1250_2.png) [@Jared\_Schulz](https://cl.desmos.com/u/Jared_Schulz)\
**Post date:** [April 10, 2023, 6:19pm UTC](https://cl.desmos.com/t/take-2-transfer-slope-to-graph-from-table-input/4831/1 "2023-04-10T18:19:35Z")

</div>

Sorry I posted the wrong link from my last question.

I am having difficulty getting the following to happen on slide 7:

I want students to input a numeric value into a table. I want the graph component to pick up that input as a numeric value, and graph a small section of that line around the given point. This way students can see how their slope at particular point matches the slope field.

Ex: For the point (-4,2) the slope is -4, or the point (0,4) has a slope of 0.

> **[6.1 - Slope Fields • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/643405471389a93c6be7deac)**
>
> by Jared Schulz

---

<div class="post-metadata">

**Author:** ![aknauft](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/aknauft/32/3701_2.png) [@aknauft](https://cl.desmos.com/u/aknauft)\
**Post date:** [April 10, 2023, 7:52pm UTC](https://cl.desmos.com/t/take-2-transfer-slope-to-graph-from-table-input/4831/2 "2023-04-10T19:52:34Z")

</div>

Hmm from what I’m seeing, you should be good:

`number(`m_1`):t1.cellNumericValue(1,3)` is going to pass down the first point’s slope (1st row, 3rd column) into the graph, where line 6 is ready to graph a section of the line with that slope: `y=m_1(x+4)+2{-4.02<x<-3.98}`.

I might tweak that condition to be `{distance((x,y),(-4,2)<0.3}` so that the overall length of the line stays the same even with extreme slopes, but it feels like you just need some copy-paste-replace for the other rows of the table!

For a bit more robustness, though, here’s an alternate to your graph: [https://www.desmos.com/calculator/vjoa7yvooi](https://www.desmos.com/calculator/vjoa7yvooi). It uses a `polygon` for each line segment, which can be a little bit faster for the calculator to draw, and also supports vertical lines for undefined slopes. For the “Multiple Points” folder, I replicated the logic of the Slope Field folder to get a `d_rawSegmentWithSlope` helper, and set it up to know about the `m1` through `m6` variables you’d be passing down via CL. (I’m imagining in the case of `und` from the student, you could pass down `\frac{1}{0}`.)

---

<div class="post-metadata">

**Author:** ![Jared\_Schulz](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jared_schulz/32/1250_2.png) [@Jared\_Schulz](https://cl.desmos.com/u/Jared_Schulz)\
**Post date:** [April 10, 2023, 8:38pm UTC](https://cl.desmos.com/t/take-2-transfer-slope-to-graph-from-table-input/4831/3 "2023-04-10T20:38:39Z")

</div>

Thanks for the help. I really appreciate the alternate graph, and like the way you can adjust the r value for a different radius. By seeing your example I realize the line was actually showing up, but changing the thickness allows you to see the line. I was able to copy the drawsegmentwith slope into the graph and everything worked well.

I like the condition to make the overall length of the slopes stay a set amount, but I couldn’t get that to work on a linear equation the way I normally adjust the domain or range. Is that just something that works with the polygon feature, or is that something I should be able to adjust at the end of a function?

 ![5](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/4/459088b267979c24a24b30f72651ba58d82c7c5d.png)

---

<div class="post-metadata">

**Author:** ![pirsquared](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@pirsquared](https://cl.desmos.com/u/pirsquared)\
**Post date:** [April 11, 2023, 4:29pm UTC](https://cl.desmos.com/t/take-2-transfer-slope-to-graph-from-table-input/4831/4 "2023-04-11T16:29:39Z")

</div>

I think you need  
`distance((x,y),(-4,2))<0.3 ` (note that the “outside” brackets start after distance and finish after the second coordinate).
