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

Algorithms

 
AnswerRe: Pi Day Pin
Shog914-Mar-07 5:03
sitebuilderShog914-Mar-07 5:03 
GeneralRe: Pi Day Pin
ricecake14-Mar-07 5:08
ricecake14-Mar-07 5:08 
AnswerRe: Pi Day Pin
Dan Neely14-Mar-07 5:15
Dan Neely14-Mar-07 5:15 
QuestionMatlab help Pin
ashee rai11-Mar-07 14:40
ashee rai11-Mar-07 14:40 
QuestionWMP Visualization help Pin
XTAL2569-Mar-07 23:34
XTAL2569-Mar-07 23:34 
AnswerRe: WMP Visualization help Pin
Luc Pattyn9-Mar-07 23:41
sitebuilderLuc Pattyn9-Mar-07 23:41 
GeneralRe: WMP Visualization help Pin
XTAL25610-Mar-07 0:33
XTAL25610-Mar-07 0:33 
GeneralRe: WMP Visualization help Pin
Luc Pattyn10-Mar-07 13:25
sitebuilderLuc Pattyn10-Mar-07 13:25 
Hi,

some remarks:

1. you managed to confuse yourself and me by using different numbering in code and drawing;

2. your code makes two distances equal: A3-A2 = B2-B1 in drawing's notation, although
drawing's annotation says otherwise.

3. you are aware I trust that RAND is called twice and will return two different numbers;
this yields independent x and y for B3 (is OK).

4. but I would make the distance B3-B2 random, so I prefer something like:

b[start].P2.x = b[start].P1.x+maxStepX*(RAND-0.5f);        
b[start].P2.y = b[start].P1.y+maxStepY*(RAND-0.5f);        


with maxStepX and maxStepY some reasonable constants (maybe equal).

Hope this helps.


Luc Pattyn

[My Articles]

GeneralRe: WMP Visualization help Pin
XTAL25610-Mar-07 22:25
XTAL25610-Mar-07 22:25 
GeneralRe: WMP Visualization help Pin
Luc Pattyn10-Mar-07 23:08
sitebuilderLuc Pattyn10-Mar-07 23:08 
GeneralRe: WMP Visualization help Pin
XTAL25611-Mar-07 16:27
XTAL25611-Mar-07 16:27 
GeneralRe: WMP Visualization help Pin
Luc Pattyn12-Mar-07 10:22
sitebuilderLuc Pattyn12-Mar-07 10:22 
GeneralRe: WMP Visualization help Pin
XTAL25612-Mar-07 21:41
XTAL25612-Mar-07 21:41 
QuestionProcessing video frames Pin
Techbear19809-Mar-07 18:42
Techbear19809-Mar-07 18:42 
AnswerRe: Processing video frames Pin
Jarno Burger14-Mar-07 0:05
Jarno Burger14-Mar-07 0:05 
AnswerRe: Processing video frames Pin
Rilhas19-May-07 10:28
Rilhas19-May-07 10:28 
QuestionPIC Pin
Bob X8-Mar-07 5:12
Bob X8-Mar-07 5:12 
AnswerRe: PIC Pin
Rilhas19-May-07 10:32
Rilhas19-May-07 10:32 
GeneralRe: PIC Pin
Bob X20-May-07 10:50
Bob X20-May-07 10:50 
GeneralRe: PIC Pin
Rilhas20-May-07 13:25
Rilhas20-May-07 13:25 
GeneralRe: PIC Pin
Bob X20-May-07 18:00
Bob X20-May-07 18:00 
NewsMock Theta Functions Pin
ricecake28-Feb-07 4:53
ricecake28-Feb-07 4:53 
QuestionFind the most appropropriate division technique Pin
kkadir25-Feb-07 1:27
kkadir25-Feb-07 1:27 
AnswerRe: Find the most appropropriate division technique Pin
Dan Neely26-Feb-07 2:19
Dan Neely26-Feb-07 2:19 
GeneralRe: Find the most appropropriate division technique Pin
kkadir26-Feb-07 5:23
kkadir26-Feb-07 5:23 

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.