Checking equation entered correctly, no graph

I am struggling with slide 13. I’ve got the table figured out, but I can’t figure out how to check to see that student entered something equivalent to D=2πR. I have been messing about with simpleFunction, parseEquation, and differenceFunction but can’t get there yet.

Maybe evaluate a few using the difference function.

studentFunction = parseEquation(input.latex).differenceFunction("D","R")
check = studentFunction.evaluateAt(2, numericValue("2\\pi*2") = 0 and {another}

You’ll get NaN if they didn’t use the correct variables, and nonzero if incorrect, so may use isDefined or something in combination.

Hmm… I’m getting X when I input D=2πR to evaluate. Not sure where I am going wrong. Sorry.


My bad I flip flopped the evaluateAt

Should be evaluateAt(numericValue("2\\pi*2),2)

Also I don’t know why I didn’t simplify to 4pi.

Bingo. I should have seen that too! Sorry. My head gets fuzzy with learning code stuff!