The reason I like Cliff's code is it lets me draw lines through the color
cube between arbitrary corners.  In my paper, I reduce the many
possibilities this raises by deciding that a "Z-to-Z" mapping gives nice
palettes; that is, connect corners on one face in a "Z" pattern, then
continue on the opposite face with another "Z" pattern.


On Sat, Aug 10, 2013 at 12:21 AM, Raul Miller <[email protected]> wrote:

> (personal response sent off list)
>
> On Fri, Aug 9, 2013 at 5:18 PM, Devon McCormick <[email protected]>
> wrote:
> > The basic code I stole from Cliff are these two things:
> >
> > NB.* pwlin: piecewise linear function
> > pwlin=: 4 : 0"_ 0
> >    'p c'=. x
> >    i=. i.&0 p<y
> >    ((1-r),r=.(y-~i{p)%-/(i-0 1){p)+/ .* (i- 0 1){c
> > )
> >
> > hue=: <.@(0.5&+)@(((6%~i.7);255*|."1#:7|3^i.7)&pwlin)"0
> > NB.EG hue 10%~i.10
>
> That looks more general than I was comfortable using.
>
> Generality can be a problem when it obscures the purpose of the code.
> So I (perhaps arbitrarily) avoid it when it "feels wrong to me". Of
> course, perhaps ironically, that's probably not an explanation which
> would be generally useful to other people.
>
> Here's a rule of thumb though: if making the code general more than
> doubles the code length? It's high time to think about if it really
> solves anything for you.
>
> Thanks,
>
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to