Being Daft with Sines and Cosines
- richmond62
- Posts: 2875
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Being Daft with Sines and Cosines
Monday being a holiday here in Bulgaria, and having fairly successfully b*ggered my shoulder in the garden yesterday, it was "quite obviously" time for me to be even more infantile than usual and do something fairly daft:
- -
If you have difficulty working out what this is, just drink about 3 glasses of the strongest alcoholic drink you can lay your hands on and then try to walk home.
- -
If you have difficulty working out what this is, just drink about 3 glasses of the strongest alcoholic drink you can lay your hands on and then try to walk home.
- Attachments
-
- Silly Sines.oxtstack.zip
- (2.64 KiB) Downloaded 18 times
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 2875
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Being Daft with Sines and Cosines
Here's a faster version (more moonshine!):
-
-
- Attachments
-
- Silly Sines_2.oxtstack.zip
- (2.65 KiB) Downloaded 17 times
https://richmondmathewson.owlstown.net/
-
- Posts: 285
- Joined: Thu Sep 16, 2021 1:40 pm
- Contact:
Re: Being Daft with Sines and Cosines
Now with Golden Ratio and Radius variability.
I turned it off for a bit and it was like BOOM! Here's some graphics!
You know what move command slows the whole thing down?I turned it off for a bit and it was like BOOM! Here's some graphics!
- richmond62
- Posts: 2875
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Being Daft with Sines and Cosines
My first stack used "set the loc", and my second one used "move to" as was messing around (waiting for the pain killer to deb*gger my shoulder) with various 'parameters'.
The first stack would be jerky, regardless: I am sure that replacing 'move to' with 'set the loc' in the second would speed things up.
Never mind: as have been doing further work in the garden, my back is sufficiently sore that I don't notice the pain in my shoulder.
Very jazzy indeed:
-
The first stack would be jerky, regardless: I am sure that replacing 'move to' with 'set the loc' in the second would speed things up.
Never mind: as have been doing further work in the garden, my back is sufficiently sore that I don't notice the pain in my shoulder.
Very jazzy indeed:
-
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 2875
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Being Daft with Sines and Cosines
If I 'de-random' my script:
motion is fairly smooth regardless of whether one uses 'move to' or 'set the loc'.
- -
it would be lovely if one could keep to that level of smoothness when one plays "silly buggers" with the graphic.
Code: Select all
on mouseUp
set the moveSpeed to 1000
put empty into fld "POYNTS"
put 0.1 into STEPP
put 1 into QOUNT
repeat until STEPP > 7
put (sin(STEPP)) into LRLOC
put (cos(STEPP)) into UDLOC
put 25 into S1
put 25 into S2
put ((LRLOC * 300)+ 375 + S1) into LRLOC
put ((UDLOC * 300)+ 375 + S2) into UDLOC
put (LRLOC & "," & UDLOC) into line QOUNT of fld "POYNTS"
set the points of grc "TRAK" to fld "POYNTS"
move grc "BLOB" to line QOUNT of fld "POYNTS"
add 0.1 to STEPP
add 1 to QOUNT
end repeat
end mouseUp
- -
it would be lovely if one could keep to that level of smoothness when one plays "silly buggers" with the graphic.
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 2875
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
- richmond62
- Posts: 2875
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Being Daft with Sines and Cosines
- Attachments
-
- Silly Sines_4.oxtstack.zip
- (11.43 KiB) Downloaded 16 times
https://richmondmathewson.owlstown.net/
-
- Posts: 285
- Joined: Thu Sep 16, 2021 1:40 pm
- Contact:
Re: Being Daft with Sines and Cosines
Neato. Should move this to the fun section.
- tperry2x
- Posts: 1639
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Britain (Previously known as Great Britain)
- Contact:
Re: Being Daft with Sines and Cosines
(moved into xtalk fun and games)
Do you mind if I were to back these up Richmond, and add to the GitHub-esque (but not actually GitHub, but Mega instead) storage?
Do you mind if I were to back these up Richmond, and add to the GitHub-esque (but not actually GitHub, but Mega instead) storage?
- richmond62
- Posts: 2875
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Being Daft with Sines and Cosines
Why on earth should I mind: You have just tickled the ego of a chap with hubris the size of Mount Everest (Err: Chomolungma).
What IS frightening is that what is going on in that stack I learnt when I was about 13-14: but the 17 year olds I am in contact with, who go to the "specialist" Maths School cannot even explain what is going on . . .
This does NOT prove I am a genius (despite having a massive ego, I know I am NOT a genius), but it proves that "things have sunk".
FFS: Basic Sine & Cosine!
-
What IS frightening is that what is going on in that stack I learnt when I was about 13-14: but the 17 year olds I am in contact with, who go to the "specialist" Maths School cannot even explain what is going on . . .
This does NOT prove I am a genius (despite having a massive ego, I know I am NOT a genius), but it proves that "things have sunk".
FFS: Basic Sine & Cosine!
-
https://richmondmathewson.owlstown.net/
- tperry2x
- Posts: 1639
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Britain (Previously known as Great Britain)
- Contact:
Re: Being Daft with Sines and Cosines
I did not do well at maths at school. I can't blame my teacher (some people have a natural ability for maths). I was quite inept at it.
Although, it didn't help that he put the fear of god into us - he would shout if someone didn't understand a concept. That was his teaching style. But all it did was make those who didn't dare ask, like myself and others, just keep quiet and let the students who could understand lead the class.
Unfortunately this meant we fell further and further behind. To this day, I have a complete mental block when it comes to maths. I just switch off.
Anyway, thank you for letting me add your examples. I'll put the link up again in a bit.
Although, it didn't help that he put the fear of god into us - he would shout if someone didn't understand a concept. That was his teaching style. But all it did was make those who didn't dare ask, like myself and others, just keep quiet and let the students who could understand lead the class.
Unfortunately this meant we fell further and further behind. To this day, I have a complete mental block when it comes to maths. I just switch off.
Anyway, thank you for letting me add your examples. I'll put the link up again in a bit.
-
- Posts: 285
- Joined: Thu Sep 16, 2021 1:40 pm
- Contact:
Re: Being Daft with Sines and Cosines
Wasn't talking about motion, I was talking about the entire speed of the script.richmond62 wrote: ↑Mon Mar 04, 2024 4:24 pm motion is fairly smooth regardless of whether one uses 'move to' or 'set the loc'.
18462 milliseconds to finish Action 1 with Move statement
1281 milliseconds to finish Action 1 with move statement commented and replaced with set the loc
That's a HUGE difference. Just think how much more time you could spend in the garden if you get things done with "Software at the speed of light" lol.
To smooth things out when doing weird random stuff, you have to add more points...how is that done?
Take point A add to point B and divided by 2 to get the halfway point.
Also probably not throwing everything into a field would help alot.
I stuck a field into my 3D thing to check some numbers and was like walking in wet cement.
Double the points, 2676 milliseconds to completion, no field because tying QUONT to the field line, ties it to the size of the graphic since add 1 to QUONT to hold each extra bit. Oh turn on, markers, that's a great way to see the complexity of the graphic.
Code: Select all
on mouseUp
set the vis of grc "BLOB" to true
set the moveSpeed to 1000
put empty into fld "POYNTS"
put 0.1 into STEPP
put 1 into QOUNT
put the milliseconds into ms
repeat until STEPP > 63
put the milliseconds -ms into field "TIME"
put (sin(STEPP)) into LRLOC
put (cos(STEPP)) into UDLOC
put QOUNT/2 into XYZ
put 25 into S1
put 25 into S2
put ((LRLOC * XYZ)+ 375 + S1) into LRLOC
put ((UDLOC * XYZ)+ 375 + S2) into UDLOC
if lastX is a number then
put (lastX+LRLOC)/2 into midX
put (lastY+UDLOC)/2 into midY
put cr & midx,midy after tPoints
--add 1 to QOUNT
end if
put LRLOC into lastX
put UDLOC into lastY
put cr & (LRLOC & "," & UDLOC) after tPoints
set the points of grc "TRAK" to tPoints
set the loc of grc "BLOB" to (LRLOC & "," & UDLOC)
add 0.1 to STEPP
add 1 to QOUNT
end repeat
set the vis of grc "BLOB" to false
set the layer of grc "TRAK" to bottom
end mouseUp
also there's so more you can do with silly sines... in 3D! This is just modifcation of example...3 from one of those stacks
Code: Select all
on DefineMagneticField
put 0.1 into STEPP
put 1 into N
repeat until STEPP > 63
put (sin(STEPP)) into X
put ((cos(STEPP)) * (sin(STEPP))) into Y
-- Generate a z-coordinate (depth) based on QOUNT
put N/2 into Z
put 60 into S1
put 60 into S2
--put ((X * (60 - Z)) + 60 + S1) into D
--put ((Y * Z) + 60 + S2) into D
put (X*(N/10)) into waveX
put (Y*(N/10)) into waveY
setXYZ "MagneticField","X",N,waveX*2
setXYZ "MagneticField","Y",N,waveY*2
setXYZ "MagneticField","Z",N,60+ Z*(sin(N)/10) ---(cos(N)*((waveX+waveY)/2))
add 0.1 to STEPP
add 1 to N
end repeat
end DefineMagneticField
on setXYZ tobject,XYZ,n,tval
put "xyz"&tObject&"Array" into tArrayName
put the tArrayName of of stack (the mainStack of this stack) into tArray
put tArray[xyz] into subArray
put tVal into subArray[n]
put subArray into tArray[xyz]
set the tArrayName of of stack (the mainStack of this stack) to tArray
end setXYZ
function getXYZ tobject,xyz,n
put "xyz"&tObject&"Array" into tArrayName
put the tArrayName of of stack (the mainStack of this stack) into tArray
put tArray[xyz] into subArray
return subArray[n]
end getXYZ
You'll need a bunch of stuff from my 3D stack to make it do things though...but those are handy handlers.
- richmond62
- Posts: 2875
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Being Daft with Sines and Cosines
Indeed: there is NO need of a scrolling list field at all: just bung the values into a monster variable with some kind of delimiter.
The reason, as ever, that I used a field is so that chummy-the-new boy/girl/hijra does not start inhaling mud because it is over their head.
The reason, as ever, that I used a field is so that chummy-the-new boy/girl/hijra does not start inhaling mud because it is over their head.
https://richmondmathewson.owlstown.net/
- tperry2x
- Posts: 1639
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Britain (Previously known as Great Britain)
- Contact:
Re: Being Daft with Sines and Cosines
As promised, in case anyone missed it, I've spent the last couple of days (on-and-off between other jobs) gathering all the related files for OpenXTalk Lite into a central repository, which is currently hosted in Mega.
Who is online
Users browsing this forum: No registered users and 1 guest