More trouble with sequences

new topic     » topic index » view thread      » older message » newer message

I hate to keep criticising the language structure, but I think that the
sequence operations ought really to go one stage further.

Suppose I have a sequence of co-ordinates

sequence coords
coords={{1,2},{50,20},{40,100}  ... }

I want to scale them

coords=coords*2

or in PP

coords =* 2


I want to scale them from a different origin...

sequence origin
origin={320,240} --middle of screen

coords=(coords-origin)*2+origin

but this does *not* work, I have to do

origin=repeat(origin,length(coords))
coords=(coords-origin)*2+origin

The same also applies if I want to stretch my co-ordinates :
coords=coords*{2,1}  --Stretch factor 2 parallel to x-axis. Not legal code

Presumably there is some reason why this is excluded Rob ?

Daniel

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu