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

Algorithms

 
GeneralRe: Mercator distance Pin
73Zeppelin6-Jun-08 3:27
73Zeppelin6-Jun-08 3:27 
QuestionWorth its Salt? Pin
Brady Kelly3-Jun-08 4:48
Brady Kelly3-Jun-08 4:48 
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 
Assuming the ellipse, rectangle and line will be made from points ordered uniformly around their 'perimeter'...

If they represent...
1) An ellipse: the distances from the geometric centre to each point will be linearly distributed... ie: the average distance from the centre should be within an epsilon amount to half way between the maximum and minimum distances.
2) A line: take any two points and calculate the 'linear line equation' y=mx+c... then see if all other points fit the equation.
3) A rectangle: the points would fit into four 'linear line equations', one for each side; find a pair of points that at least one other points fits into, repeat with the remaining points until four sides have been found and there are no points left. (This is the hardest of the three... there may be a better way).
4) A polygon... if none of the other conditions apply.

Calculating the bounding rectangle is simple... look for maximum/minimum points in both the vertical/horizontal directions.

I believe I've done something like this before... I'll see if I can find some code.

Hope this helps.

Matthew Butler

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 
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 

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.