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 . . .
a customized drag command
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 9389
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: a customized drag command
how did you ensure that all the points are at the same distance from one another?richmond62 wrote: ↑Fri Apr 08, 2022 9:14 amThat is why in both my linear and my circular example I have taken pains to ensure the jumps
are even:
Samuele.
-
- Livecode Opensource Backer
- Posts: 9389
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: a customized drag command
Nothing more than a bit of very simple Mathematics: dig around in my stack: I have a feeling that there ishow did you ensure that all the points are at the same distance from one another?
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.
Re: a customized drag command
yes it's this:
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!
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
sorry for my ignorance
Thanks!
Samuele.
-
- Livecode Opensource Backer
- Posts: 9389
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: a customized drag command
I use one formula which 'Bonehead' Barker, my fantastic Maths teacher taught my classwhich formulas you use? Is it like this because it's a circle?
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.