Evaluate moveable points on a graph

I am new to working in the computation layer and I can’t seem to find how to make this work… I created a graph with four moveable points (A, B, C, and D). Each point has to be moved to a specific coordinate on the graph to create a rectangle. What coding do I write in CL to evaluate the location where the points are placed. I am not looking for students to get feedback. I just want it to show correct/incorrect on the teacher dashboard.

Hi Teresa,

You can do this in CL by referring to the graph and extracting a number for each coordinate. For instance, if your graph is named gra then you can refer to gra.number(`A.x`) to get the x-coordinate of A, gra.number(`A.y`) to get the y-coordinate, etc.

See here for an example in practice.

Here’s an approach - you can do the calculations inside the graph, and report out correctness as a number. This is a template you can use. checking coordinates • Activity Builder by Desmos Classroom

1 Like

Thank you so much! I am going to try this out ASAP. As I look into the future I can see my next question being… What if multiple solutions are possible for each point?

For example… I have two given points for the length of a rectangle. The area of the rectangle is specified. Drag the two remaining points to possible locations.

Thank you very much! I look forward to trying this soon. As I look into the progression of this topic, I will be creating questions that would make it possible for multiple solutions to be correct for each point. For example… I have two given points for the length of a rectangle. The area of the rectangle is specified. Drag the two remaining points to possible locations.

Like @Daniel_Wekselgreene advises, you can do a lot of the heavy lifting in the graph. Assuming that A and B are the given points, and C and D are the students’ moveable points, then the area can be calculated from something like A_rea = (C.x - A.x) * (B.y - A.y) depending on the order of the coordinates. You’d then need to introduce a check to make sure what they’ve produced is a rectangle, and since they are needing to be precise in where they place the coordinates I would also introduce a bit of ‘snapping’ (so that they can’t drag a point to (3.96,4.01) instead of (4,4)).

Have a look at the following and let us know if there’s anything that does not make sense:

Also, if you wanted to get really fancy, you could use the sketch tool to enable students to draw the points directly on the graph rather than dragging the coordinates. See Slide 13 for an example:

@pirsquared and @Daniel_Wekselgreene, always appreciate both your contributions here! I wonder if you’re using an older template from before draggable points were customizable, @Daniel_Wekselgreene?
You can alternately start your points at (0,0) without any need to define sliders for the individual coordinates. Aside from that, I feel there are so many that forget or don’t know about the distance() function in the graph. Sooo useful for validating points!

@Daniel_Grubbs I’ve seen that you can define a draggable point like p = (0, 0) without variables, but what do you mean about customizable? I don’t see a way to set step size, for example, without defining the coordinates as variables.

That’s true. You can’t set steps. There used to not even be a toggle in the menu, and you had to use sliders to make a draggable point.

I am going to give all of this a whirl!!! I can’t express how much I appreciate all of your insight!! I am really new to this but I am going to give it my best! On a side note… I have been a bit apprehensive about CL and where I have been rather frustrated at times… I am actually enjoying it much more than I thought!!! Fingers crossed!

Welcome to the rabbit hole… the more you learn the more fun you’ll have and the more you’ll want to learn. Feel free to ask questions whenever you need. You’ll probably find that you’ll have tons of questions at the start and then as you go, things will click into place, and eventually you’ll be here answering other peoples’ questions.

1 Like