I need the user to write an equation that has 4/3 as the slope and a y-intercept larger than 10/3. I don’t know how to do this because of the fractions.
In this case, you will want to check against the numeric value of the latex expression, since you can’t do calculations directly in CL. So you change your check line to:
check = m = numericValue(`\frac{4}{3}`) and b > numericValue(`\frac{10}{3}`)
If you don’t know latex formatting, the easiest way is to type the expression you want in desmos, copy it, and then paste it into the CL. It will be formatted correctly.
I think this would be better handled the way @Jennifer_Knarr had originally coded it. It was just missing grabbing the xyLine stuff from the input. Namely:
#grabs the numeric values for slope and y-intercept
m=myLine.slope
b=myLine.yIntercept
mInput=xyLine(this.latex).slope
bInput=xyLine(this.latex).yIntercept
#checks that they are equivalent to intended values.
check=m=mInput and b=bInput
I should clarify - I just meant replacing that particular line of code in the original with what I wrote, not replacing the whole thing. The issue was how to compare to a fraction, which needs something like the numericValue method to work. When I first learned CL, this really confused me because I always expected basic math operations to work like in other languages.