I am obsessed with making activities with interaction. I am doing activities that involve working with pi, and it’s a nightmare because when comparing you never know how many digits desmos will use.
correct:
when input2.numericValue = 3.14159 true
otherwise false
I would like this to work no matter how many digits the students writes after 3.14. Let’s say when the error is less than 0.01 it would be correct.
This could easily be done in any programming language but in Desmos I find it difficult. Any ideas?
[cwinske] You introduce me to the using pi inside the code. I did not know this was possible
[Daniel_Grubbs] That’s exactly what I wanted to achieve. And you did it in such an elegant way that I am so amazed! It does work.
I have learnt so much from it.
Where can I get documentation of it? Are you actually using the same functions of the desmos calculator in the code? Are actually, the sinks, variables of the Desmos calculator?
The numericValue functions just converts a Latex expression to a Math evaluable expression. Inside of those Latex expression you can use a variable as long as you put it in the form ${variable}.
I am unsure if Desmos provides Latex documentation. I was unable to find anything.
I usually handle these type of correctness with using a correctness checker built-in to the graph component. Check if c_1={pi - a < .01: 1,0}
Here “a” would be the student input and the level of precision. Then the value c_1 tells me it is correct if 1, false if 0… which comes in handy if you ever create correctness checkers for multiple parameters.
Totally spaced on using the graph, PanettaMath. Usually, the easiest way to deal with any calculations if possible. Random numbers are the only thing that seem less complicated in CL.
Roger, there’s not really any latex documentation for Desmos specifically. However, if you know how to do it in a graph, do that and then copy paste it into the CL. It’ll convert it for you. You can just google for a specific LaTex notation. Just note that when a single backslash is used for LaTex (and in Desmos graph), CL requires a double backslash.