1
$\begingroup$

Possible Duplicate:
Error measurement between given perfect 2D shape and freeform shape drawn by user

I am programming (with vectors) an application which requires a user to draw line according to certain data. Then the user will click a check button which will grade the users drawing to the actual data line. So I am wondering how would I go about grading the accuracy of the two lines?

So far what I have been able to do is interpolate the entire line of both the user line and the actual line. So that the user lines data can match with the actual line data.

What is my next step in finding the accuracy of the user line to the actual line?

I can't use area because the line the user draws is not linear, its freeform.

Heres an image of what i mean:

enter image description here

  • 1
    From your image, I think Area will work.2011-12-05

1 Answers 1

1

Lets say user line is $g(x)$ and line drawn by you is $f(x)$

Then grade can be made be inversely proportional to

$\displaystyle \sum_{x=a}^{b} (g(x)-f(x))^2$

This is commonly used function.

  • 1
    This just avoids taking the root and average. So it saves computation. We are using this in stanford ml-class online. :) @picakhu is right its just RMS squared times number of points!2011-12-05