# Creating bounds on graph that zoom in based on student's input

**URL:** <https://cl.desmos.com/t/creating-bounds-on-graph-that-zoom-in-based-on-students-input/911>\
**Category:** Questions\
**Created:** [April 28, 2020, 11:13pm UTC](https://cl.desmos.com/t/creating-bounds-on-graph-that-zoom-in-based-on-students-input/911 "2020-04-28T23:13:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ann\_Nitka-Johnson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/ann_nitka-johnson/32/721_2.png) [@Ann\_Nitka-Johnson](https://cl.desmos.com/u/Ann_Nitka-Johnson)\
**Post date:** [April 28, 2020, 11:13pm UTC](https://cl.desmos.com/t/creating-bounds-on-graph-that-zoom-in-based-on-students-input/911/1 "2020-04-28T23:13:13Z")

</div>

If I want students to input an equation to see if it graphs as a linear or quadratic function, how can I set the bounds so that if they get creative and go beyond a -10 to 10 boundary that the graph will zoom in for them?

---

<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:** [April 29, 2020, 4:32am UTC](https://cl.desmos.com/t/creating-bounds-on-graph-that-zoom-in-based-on-students-input/911/2 "2020-04-29T04:32:59Z")

</div>

`bounds: makeBounds(a,b,c,d)`

You can make variables that use whatever parameters you want to use for the bounds.

---

<div class="post-metadata">

**Author:** ![MrKit](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mrkit/32/718_2.png) [@MrKit](https://cl.desmos.com/u/MrKit)\
**Post date:** [May 14, 2020, 8:04pm UTC](https://cl.desmos.com/t/creating-bounds-on-graph-that-zoom-in-based-on-students-input/911/3 "2020-05-14T20:04:31Z")

</div>

What kind of parameters would you recommend here? Like, if a student is inputting a quadratic equation [for example y = (x - 50)(x+22) or y = -0.01x^2 - 16x + 22], how would we get the bounds to zoom out so that the graph’s “key points” always show up? (i.e. the vertex, y-intercept, and x-intercepts, if applicable)?

---

<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:** [May 14, 2020, 8:36pm UTC](https://cl.desmos.com/t/creating-bounds-on-graph-that-zoom-in-based-on-students-input/911/4 "2020-05-14T20:36:28Z")

</div>

Sounds complicated. I mean y-intercept is simple enough. Maybe just use a full-screen graph (only have a graph component), so they can zoom in and out freely.

---

<div class="post-metadata">

**Author:** ![Zachary\_Palcic](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/zachary_palcic/32/2035_2.png) [@Zachary\_Palcic](https://cl.desmos.com/u/Zachary_Palcic)\
**Post date:** [March 28, 2021, 1:27am UTC](https://cl.desmos.com/t/creating-bounds-on-graph-that-zoom-in-based-on-students-input/911/5 "2021-03-28T01:27:54Z")

</div>

I’m trying to do something similar to this question so that I don’t have to change the graph every time I make a new activity when graphing different relationships. How do you define a,b,c,d to be the maximum and minimum values when those values can different each 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:** [March 28, 2021, 3:27am UTC](https://cl.desmos.com/t/creating-bounds-on-graph-that-zoom-in-based-on-students-input/911/6 "2021-03-28T03:27:59Z")

</div>

You can have some sort of calculation done in the graph and then define variables in the CL pulling those values. In a quadratic, for example, you can calculate A, B, and C (of standard form) in the graph:

```auto
C=f(0)
B=f'(0)
A=f''(0)/2

```

Then use the quadratic formula for x-intercepts if present. You could also calculate h and k for the vertex. Add or subtract some units to make max and min values for x- and y-axes. Whatever you name those you can call them into the CL to use for bounds:

```auto
xmax=this.number(`x_{max}`)
xmin=this.number(`x_{min}`)
...etc
bounds: makeBounds(xmin, xmax, ymin, ymax)

```

You may have to get creative with calculations depending on your expectations of what student input may be.

---

<div class="post-metadata">

**Author:** ![Zachary\_Palcic](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/zachary_palcic/32/2035_2.png) [@Zachary\_Palcic](https://cl.desmos.com/u/Zachary_Palcic)\
**Post date:** [March 28, 2021, 11:39pm UTC](https://cl.desmos.com/t/creating-bounds-on-graph-that-zoom-in-based-on-students-input/911/7 "2021-03-28T23:39:41Z")

</div>

Thank you for the reply!
