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

C#

 
GeneralRe: Problem at inserting a DB entry Pin
Eddy Vluggen7-Nov-18 1:44
professionalEddy Vluggen7-Nov-18 1:44 
AnswerRe: Problem at inserting a DB entry Pin
tranthanhtu.vn7-Nov-18 2:29
professionaltranthanhtu.vn7-Nov-18 2:29 
GeneralRe: Problem at inserting a DB entry Pin
Eddy Vluggen7-Nov-18 2:37
professionalEddy Vluggen7-Nov-18 2:37 
AnswerRe: Problem at inserting a DB entry Pin
tranthanhtu.vn7-Nov-18 2:42
professionaltranthanhtu.vn7-Nov-18 2:42 
QuestionCorrelation of several multi-track charts in C# Pin
Member 133258465-Nov-18 19:13
Member 133258465-Nov-18 19:13 
Question[solved] GuidAttribute Pin
Super Lloyd5-Nov-18 2:29
Super Lloyd5-Nov-18 2:29 
QuestionCreating & writing to a text file from two different forms Pin
Member 140427683-Nov-18 9:45
Member 140427683-Nov-18 9:45 
AnswerRe: Creating & writing to a text file from two different forms Pin
Dave Kreskowiak3-Nov-18 10:06
mveDave Kreskowiak3-Nov-18 10:06 
GeneralRe: Creating & writing to a text file from two different forms Pin
Member 140427684-Nov-18 4:03
Member 140427684-Nov-18 4:03 
GeneralRe: Creating & writing to a text file from two different forms Pin
Eddy Vluggen4-Nov-18 4:15
professionalEddy Vluggen4-Nov-18 4:15 
GeneralRe: Creating & writing to a text file from two different forms Pin
OriginalGriff4-Nov-18 6:34
mveOriginalGriff4-Nov-18 6:34 
AnswerRe: Creating & writing to a text file from two different forms Pin
Richard MacCutchan3-Nov-18 10:07
mveRichard MacCutchan3-Nov-18 10:07 
AnswerRe: Creating & writing to a text file from two different forms Pin
OriginalGriff3-Nov-18 20:28
mveOriginalGriff3-Nov-18 20:28 
AnswerRe: Creating & writing to a text file from two different forms Pin
BillWoodruff4-Nov-18 6:47
professionalBillWoodruff4-Nov-18 6:47 
Questionbest mothod for save file database C# Pin
arman02-Nov-18 4:40
arman02-Nov-18 4:40 
AnswerRe: best mothod for save file database C# Pin
OriginalGriff2-Nov-18 5:16
mveOriginalGriff2-Nov-18 5:16 
AnswerRe: best mothod for save file database C# Pin
Gerry Schmitz2-Nov-18 6:06
mveGerry Schmitz2-Nov-18 6:06 
AnswerRe: best mothod for save file database C# Pin
Eddy Vluggen3-Nov-18 2:07
professionalEddy Vluggen3-Nov-18 2:07 
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 
Analytical Geometry to the rescue!

Given point (X0, Y0), return all points (X, Y) such that |X - X0| + |Y - Y0| <= R.

For the row Y == Y0, this is trivially all the points (X, Y0), X0 - R <= X <= X0 + R.
For the rows Y == Y0+/-1, this is trivially all the points (X, Y0+/-1), X0 - R + 1 <= X <= X0 + R - 1.
For the rows Y == Y0+/-n, this is trivially all the points (X, Y0+/-n), X0 - R + n <= X <= X0 + R - n.
And for Y == Y0+/-R, this is trivially the points (X0, Y0+/-R).

No coordinates are explicitly calculated, and no point is visited more than once.

Note that this approach would work for the more conventional distance, as well. Use Bresenham's circle-drawing algorithm to calculate the end-points of each row.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.

AnswerRe: List of surrounding points Pin
BillWoodruff9-Nov-18 13:26
professionalBillWoodruff9-Nov-18 13:26 

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.