Click here to Skip to main content
15,894,825 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Worth its Salt? Pin
Arash Partow3-Jun-08 8:21
Arash Partow3-Jun-08 8:21 
GeneralRe: Worth its Salt? Pin
Brady Kelly3-Jun-08 22:34
Brady Kelly3-Jun-08 22:34 
QuestionAuto Update Algorithm Pin
Richard Andrew x6431-May-08 14:19
professionalRichard Andrew x6431-May-08 14:19 
AnswerRe: Auto Update Algorithm Pin
Nelek1-Jun-08 5:37
protectorNelek1-Jun-08 5:37 
QuestionSimple shape recognition Pin
Jim Crafton30-May-08 9:20
Jim Crafton30-May-08 9:20 
AnswerRe: Simple shape recognition Pin
Matthew Butler30-May-08 10:08
Matthew Butler30-May-08 10:08 
GeneralRe: Simple shape recognition Pin
Jim Crafton30-May-08 10:19
Jim Crafton30-May-08 10:19 
GeneralRe: Simple shape recognition Pin
Matthew Butler30-May-08 10:49
Matthew Butler30-May-08 10:49 
To solve the 'random mouse speed' you could only draw the next point when it is a pre-determined distance from the last... however that may not fit in with your design.

However a better way may be to look at the angles between successive points...
(This is how I did it)...
For a line, the angles would be around 180 degrees.
For a rectangle, there will be (over a few points), 3 x 90 degree turns, with the rest 180 degrees. (The end point will be in proximity to the first).
For an ellipse, the angles will always be either below or above 180 degrees... depending on whether it is drawn clockwise or not.
And a polygon will not follow any of the previous patterns.
... self explanitory.

I stored each shape's pattern and iterated through them looking for a match... similar to a regex... but geometrically, with an 'accuracy' value.
If not accurate enough (<75%), I assumed it to be random.

Hope this helps.

Matthew Butler

JokeRe: Simple shape recognition Pin
Brady Kelly3-Jun-08 4:51
Brady Kelly3-Jun-08 4:51 
GeneralRe: Simple shape recognition Pin
Matthew Butler4-Jun-08 11:36
Matthew Butler4-Jun-08 11:36 
GeneralRe: Simple shape recognition Pin
Member 419459330-May-08 11:56
Member 419459330-May-08 11:56 
GeneralRe: Simple shape recognition Pin
Matthew Butler30-May-08 12:46
Matthew Butler30-May-08 12:46 
AnswerRe: Simple shape recognition Pin
Arash Partow30-May-08 14:03
Arash Partow30-May-08 14:03 
AnswerRe: Simple shape recognition Pin
RichardM130-May-08 19:25
RichardM130-May-08 19:25 
QuestionFourier Series Question Pin
MarkB77724-May-08 5:45
MarkB77724-May-08 5:45 
AnswerRe: Fourier Series Question Pin
73Zeppelin24-May-08 8:11
73Zeppelin24-May-08 8:11 
GeneralRe: Fourier Series Question Pin
MarkB77724-May-08 14:26
MarkB77724-May-08 14:26 
RantRe: Fourier Series Question Pin
Nelek24-May-08 15:57
protectorNelek24-May-08 15:57 
GeneralRe: Fourier Series Question Pin
Brady Kelly31-May-08 22:42
Brady Kelly31-May-08 22:42 
GeneralRe: Fourier Series Question Pin
Nelek1-Jun-08 5:33
protectorNelek1-Jun-08 5:33 
AnswerRe: Fourier Series Question Pin
MarkB77724-May-08 21:17
MarkB77724-May-08 21:17 
GeneralRe: Fourier Series Question Pin
73Zeppelin24-May-08 22:08
73Zeppelin24-May-08 22:08 
QuestionDrawing a sketch with constraints Pin
Member 103128822-May-08 12:37
Member 103128822-May-08 12:37 
AnswerRe: Drawing a sketch with constraints Pin
73Zeppelin22-May-08 19:32
73Zeppelin22-May-08 19:32 
GeneralRe: Drawing a sketch with constraints Pin
Member 103128823-May-08 5:45
Member 103128823-May-08 5:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.