Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have a set of x, y co-ordinates that are actually taken from hand drawings of a circle, square or a triangle. Using the set of points, I need to mathematically find if the points approximately fit a square, circle or a triangle. What is the ideal way to implement this case?

share|improve this question
2  
Are you looking for a computational solution? This generally belongs to the field of machine learning/pattern recognition in computer science, and is often performed as OCR (Optical Character Recognition). The most common approach is to train your algorithm on many samples of each of the handwritten characters, find a common mathematical pattern and use that for prediction. –  Bitwise Oct 7 '12 at 3:46
add comment

2 Answers 2

Calculate all the slopes between pairs of points, and order them. If there are two numbers that show up repeatedly in your list, you've got a square; three, a triangle; none; a circle.

This assumes that the given points are many in number and sampled randomly from the drawing.

share|improve this answer
add comment

You also could use Hough transform. There are large number of this implementation of different programming languages. For more clearness, I post link with web example here.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.