Click here to Skip to main content
15,892,059 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Determine straight line Pin
tagopi7-Aug-12 1:30
tagopi7-Aug-12 1:30 
GeneralRe: Determine straight line Pin
Amarnath S7-Aug-12 1:45
professionalAmarnath S7-Aug-12 1:45 
GeneralRe: Determine straight line Pin
tagopi7-Aug-12 1:49
tagopi7-Aug-12 1:49 
GeneralRe: Determine straight line Pin
Eugen Podsypalnikov7-Aug-12 4:14
Eugen Podsypalnikov7-Aug-12 4:14 
GeneralRe: Determine straight line Pin
Amarnath S7-Aug-12 1:51
professionalAmarnath S7-Aug-12 1:51 
SuggestionRe: Determine straight line Pin
Albert Holguin7-Aug-12 1:40
professionalAlbert Holguin7-Aug-12 1:40 
GeneralRe: Determine straight line Pin
tagopi7-Aug-12 1:50
tagopi7-Aug-12 1:50 
AnswerRe: Determine straight line Pin
pasztorpisti7-Aug-12 5:57
pasztorpisti7-Aug-12 5:57 
With some algorithm you should pick 2 points that are far enough from each other. After this you can create a line object using these 2 points. The line object can be used to easily determine the distance of the other points from this line and you can accept distances less then a defined epsilon value.

An O(n) algorithm to determine the 2 endpoints (assuming that the points are in a line) before your create the line object:
Initialize an empty bounding AABB and then expand it by adding all points. Declare six point variables and each of them should store the last point that was used to expand the AABB in +x,-x,+y,-y,+z,-z directions (note: the first point should fill all the six variables).
When this is done choose a dimension in which the size of the AABB is the biggest (x, y, or z). If the biggest dimension is zero (or near zero) then all points are located at the same spot.
Lets say its x: in this case the two endpoints (from the previously mentioned 6 point variables) are the points that were stored when the AABB was expanded last time in -x and +x directions.
AnswerRe: Determine straight line Pin
CPallini7-Aug-12 21:17
mveCPallini7-Aug-12 21:17 
QuestionC++ middleware with GUI in C Pin
Member 83997696-Aug-12 20:02
Member 83997696-Aug-12 20:02 
AnswerRe: C++ middleware with GUI in C Pin
Richard MacCutchan6-Aug-12 20:59
mveRichard MacCutchan6-Aug-12 20:59 
GeneralRe: C++ middleware with GUI in C Pin
Member 83997696-Aug-12 21:58
Member 83997696-Aug-12 21:58 
GeneralRe: C++ middleware with GUI in C Pin
Richard MacCutchan6-Aug-12 22:46
mveRichard MacCutchan6-Aug-12 22:46 
GeneralRe: C++ middleware with GUI in C Pin
JohnAspras6-Aug-12 21:21
JohnAspras6-Aug-12 21:21 
GeneralRe: C++ middleware with GUI in C Pin
Software_Developer6-Aug-12 22:42
Software_Developer6-Aug-12 22:42 
AnswerRe: C++ middleware with GUI in C Pin
pasztorpisti7-Aug-12 11:53
pasztorpisti7-Aug-12 11:53 
GeneralRe: C++ middleware with GUI in C Pin
Member 83997697-Aug-12 19:18
Member 83997697-Aug-12 19:18 
GeneralRe: C++ middleware with GUI in C Pin
pasztorpisti7-Aug-12 21:13
pasztorpisti7-Aug-12 21:13 
GeneralNeed help for a Ray Cast Function Pin
SD1016-Aug-12 8:15
SD1016-Aug-12 8:15 
GeneralRe: Need help for a Ray Cast Function Pin
Wes Aday6-Aug-12 8:20
professionalWes Aday6-Aug-12 8:20 
GeneralRe: Need help for a Ray Cast Function Pin
Software_Developer6-Aug-12 9:02
Software_Developer6-Aug-12 9:02 
Questionvectors Pin
Xarzu6-Aug-12 7:10
Xarzu6-Aug-12 7:10 
GeneralRe: vectors Pin
Software_Developer6-Aug-12 7:34
Software_Developer6-Aug-12 7:34 
AnswerRe: vectors Pin
Albert Holguin6-Aug-12 7:38
professionalAlbert Holguin6-Aug-12 7:38 
QuestionI'm doing a file download client,use http or ftp Pin
jiang1988jian5-Aug-12 23:34
jiang1988jian5-Aug-12 23:34 

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.