Page 3 of 3

Re: a customized drag command

Posted: Fri Apr 08, 2022 9:14 am
by richmond62
Indeed: it is important to have evenly spaced 'jumps' in your multi-point line.

That is why in both my linear and my circular example I have taken pains to ensure the jumps
are even:

Calculate the total distance and divide it by however many 'jumps' you want . . .

Re: a customized drag command

Posted: Wed Apr 27, 2022 2:50 pm
by Samuele
richmond62 wrote:
Fri Apr 08, 2022 9:14 am
That is why in both my linear and my circular example I have taken pains to ensure the jumps
are even:
how did you ensure that all the points are at the same distance from one another?

Re: a customized drag command

Posted: Wed Apr 27, 2022 7:31 pm
by richmond62
how did you ensure that all the points are at the same distance from one another?
Nothing more than a bit of very simple Mathematics: dig around in my stack: I have a feeling that there is
a hidden button with a script to generate a cirle somewhere . . .

. . . if you have no luck send me a message and I'll see if I can find that stack amongst my piles and piles
of stuff. 8)

Re: a customized drag command

Posted: Thu Apr 28, 2022 10:49 am
by Samuele
yes it's this:

Code: Select all

on mouseUp
   put empty into fld "PPP"
   wait 10 ticks
   put 0.1 into SEED
   repeat until SEED > 7
      put ((300 * (cos(SEED))) + 350) into COSSEED
      put ((300 * (sin(SEED))) + 350) into SINSEED
      put (SEED * 10) into TSEED
      put COSSEED & "," & SINSEED into line TSEED of fld "PPP"
      add 0.1 to SEED
   end repeat
   set the points of grc "CC" to fld "PPP"
end mouseUp
but I don't quite understand it, which formulas you use? Is it like this because it's a circle? and if I want to do it with a line it would be simpler?
sorry for my ignorance
Thanks!

Re: a customized drag command

Posted: Thu Apr 28, 2022 11:21 am
by richmond62
which formulas you use? Is it like this because it's a circle?
I use one formula which 'Bonehead' Barker, my fantastic Maths teacher taught my class
when I was 13 so we could plot a circle, by hand,on a piece of graph paper with a pencil.

I am extremely grateful for the fact that when I was 13 all we had were slide-rules, logarithmic tables,
pencils, paper and our brains, so we understood the underpinnings of stuff like plotting a curve which
is hidden away by calculators and computers,

Obviously if you want a different type of line you will need a different formula.