Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
QuestionList of surrounding points Pin
Bernhard Hiller2-Nov-18 3:16
Bernhard Hiller2-Nov-18 3:16 
AnswerRe: List of surrounding points Pin
Dar Brett2-Nov-18 5:15
Dar Brett2-Nov-18 5:15 
GeneralRe: List of surrounding points Pin
Bernhard Hiller4-Nov-18 21:44
Bernhard Hiller4-Nov-18 21:44 
AnswerRe: List of surrounding points Pin
Gerry Schmitz2-Nov-18 5:50
mveGerry Schmitz2-Nov-18 5:50 
GeneralRe: List of surrounding points Pin
BillWoodruff9-Nov-18 13:28
professionalBillWoodruff9-Nov-18 13:28 
AnswerRe: List of surrounding points Pin
Daniel Pfeffer4-Nov-18 23:53
professionalDaniel Pfeffer4-Nov-18 23:53 
AnswerRe: List of surrounding points Pin
BillWoodruff9-Nov-18 13:26
professionalBillWoodruff9-Nov-18 13:26 
GeneralRe: List of surrounding points Pin
Bernhard Hiller11-Nov-18 21:33
Bernhard Hiller11-Nov-18 21:33 
Thanks, Bill. That could pave the way to a solution.
I really need some kind of "List" of those points - IEnumerable is necessary, Count would be nice, mutability is not required at all. That "list" will be used as a parameter in further calculations.
So, a solution could be:
- create a rectangle enclosing all original points (that's O(n) for number of points)
- create a 2-dimensional array of bool, and map those points (i.e. x and y of the point become indices of the array, and there the value is set to true)
- create a 2-dimensional array of bool for the result. It's bigger, and the size can easily be determined.
- either
- - iterate over all result array and find out if a point of the original array can be reached
- - iterate over the original array and mark all points which can be reached in the result array. In contrast to the HashSet implementation, there is no need to check for duplicates: it does not matter if an item already true is set to true again.
- re-map the array to a List of Point
That should be O(n) for the number of original points (which is my main concern), but stil O(n^2) for the distance (which is a configurable value, and should not vary to much).
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!

GeneralRe: List of surrounding points Pin
BillWoodruff11-Nov-18 22:26
professionalBillWoodruff11-Nov-18 22:26 
GeneralRe: List of surrounding points Pin
Bernhard Hiller13-Nov-18 21:57
Bernhard Hiller13-Nov-18 21:57 
GeneralRe: List of surrounding points Pin
BillWoodruff13-Nov-18 22:05
professionalBillWoodruff13-Nov-18 22:05 
GeneralRe: List of surrounding points Pin
Bernhard Hiller13-Nov-18 22:22
Bernhard Hiller13-Nov-18 22:22 
Question[SOLVED] I need help with NIM GAME IN C# Pin
RES7B4-Nov-18 5:23
RES7B4-Nov-18 5:23 
AnswerRe: I need help with NIM GAME IN C# Pin
OriginalGriff1-Nov-18 21:07
mveOriginalGriff1-Nov-18 21:07 
AnswerRe: I need help with NIM GAME IN C# Pin
Eddy Vluggen4-Nov-18 3:48
professionalEddy Vluggen4-Nov-18 3:48 
AnswerRe: [SOLVED] I need help with NIM GAME IN C# Pin
F-ES Sitecore5-Nov-18 2:32
professionalF-ES Sitecore5-Nov-18 2:32 
QuestionHow to update data to existing PDF using Itextsharp library Pin
pondurelakshman30-Oct-18 19:27
pondurelakshman30-Oct-18 19:27 
AnswerRe: How to update data to existing PDF using Itextsharp library Pin
Richard MacCutchan31-Oct-18 3:09
mveRichard MacCutchan31-Oct-18 3:09 
QuestionWhat is good practice Pin
Member 1351454029-Oct-18 9:57
Member 1351454029-Oct-18 9:57 
AnswerRe: What is good practice Pin
BillWoodruff29-Oct-18 11:45
professionalBillWoodruff29-Oct-18 11:45 
SuggestionRe: What is good practice Pin
josda100030-Oct-18 6:51
josda100030-Oct-18 6:51 
GeneralRe: What is good practice Pin
BillWoodruff30-Oct-18 17:08
professionalBillWoodruff30-Oct-18 17:08 
AnswerRe: What is good practice Pin
Bernhard Hiller30-Oct-18 22:49
Bernhard Hiller30-Oct-18 22:49 
QuestionUsing InPlaceBitmapMetadataWriter To Write Keywords Failing on Photos from Recent Cameras Pin
richmhouse29-Oct-18 7:37
richmhouse29-Oct-18 7:37 
QuestionScrolling reset when application regains focus Pin
pr1mem0ver29-Oct-18 2:58
pr1mem0ver29-Oct-18 2:58 

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.