Click here to Skip to main content
15,892,005 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionColor Ranges Pin
Malcolm Smart20-Jul-07 5:29
Malcolm Smart20-Jul-07 5:29 
AnswerRe: Color Ranges Pin
Luc Pattyn20-Jul-07 5:45
sitebuilderLuc Pattyn20-Jul-07 5:45 
GeneralRe: Color Ranges Pin
Malcolm Smart20-Jul-07 10:37
Malcolm Smart20-Jul-07 10:37 
GeneralRe: Color Ranges Pin
Paul Conrad20-Jul-07 10:40
professionalPaul Conrad20-Jul-07 10:40 
GeneralRe: Color Ranges Pin
Malcolm Smart20-Jul-07 11:22
Malcolm Smart20-Jul-07 11:22 
GeneralRe: Color Ranges Pin
Paul Conrad20-Jul-07 11:27
professionalPaul Conrad20-Jul-07 11:27 
GeneralRe: Color Ranges Pin
Luc Pattyn20-Jul-07 15:42
sitebuilderLuc Pattyn20-Jul-07 15:42 
AnswerRe: Color Ranges Pin
CPallini20-Jul-07 11:33
mveCPallini20-Jul-07 11:33 
I think (on empirical grounds) that you can try to use the following formula:

g(n)= (int) ( 255 * cos( n * pi / 200) + .5)
r(n)= (int) ( 255 * sin( n * pi / 200) + .5)


where:
double pi = 3.14159..........
 0 <= n <= 100


The starting point for the above formulas was the fact that at the middle point of the Microsoft Word's gradiend there is no pure yellow, but a darker one.
So I made the following hypothesis (maybe are wrong, maybe that are, neverthless, useful):

(1) You have to pass from Red to Green keeping constant intensity.
(2) Intensity is proportional to the square root of the summed up squares of the rgb components, namely:
i(r,g,b) = sqrt( r*r + g*g + b*b)


I don't know if the above formulas give a good gradient approximation, I have not yet made a test...
Hope that helps.

Smile | :)


If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

GeneralRe: Color Ranges Pin
Luc Pattyn21-Jul-07 3:49
sitebuilderLuc Pattyn21-Jul-07 3:49 
GeneralRe: Color Ranges Pin
Malcolm Smart21-Jul-07 3:58
Malcolm Smart21-Jul-07 3:58 
GeneralRe: Color Ranges Pin
Luc Pattyn21-Jul-07 4:03
sitebuilderLuc Pattyn21-Jul-07 4:03 
GeneralRe: Color Ranges Pin
CPallini21-Jul-07 10:14
mveCPallini21-Jul-07 10:14 
GeneralRe: Color Ranges Pin
Malcolm Smart22-Jul-07 21:20
Malcolm Smart22-Jul-07 21:20 
GeneralRe: Color Ranges Pin
CPallini22-Jul-07 21:28
mveCPallini22-Jul-07 21:28 
GeneralRe: Color Ranges Pin
Malcolm Smart22-Jul-07 23:33
Malcolm Smart22-Jul-07 23:33 
GeneralRe: Color Ranges Pin
CPallini22-Jul-07 23:41
mveCPallini22-Jul-07 23:41 
Questionfinding all recurring elements in an array Pin
Rocky#17-Jul-07 6:40
Rocky#17-Jul-07 6:40 
AnswerRe: finding all recurring elements in an array Pin
El Corazon17-Jul-07 6:56
El Corazon17-Jul-07 6:56 
GeneralRe: finding all recurring elements in an array Pin
Dan Neely17-Jul-07 7:08
Dan Neely17-Jul-07 7:08 
GeneralRe: finding all recurring elements in an array Pin
El Corazon17-Jul-07 7:11
El Corazon17-Jul-07 7:11 
GeneralRe: finding all recurring elements in an array Pin
Rocky#17-Jul-07 7:13
Rocky#17-Jul-07 7:13 
AnswerRe: finding all recurring elements in an array Pin
Luc Pattyn17-Jul-07 7:28
sitebuilderLuc Pattyn17-Jul-07 7:28 
AnswerRe: finding all recurring elements in an array Pin
PICguy22-Jul-07 12:10
PICguy22-Jul-07 12:10 
QuestionInteresting math magic? Pin
Paul Conrad15-Jul-07 12:35
professionalPaul Conrad15-Jul-07 12:35 
AnswerRe: Interesting math magic? Pin
cp987616-Jul-07 12:49
cp987616-Jul-07 12:49 

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.