This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-09-23 18:19:43

recycle49
Scratcher
Registered: 2009-12-21
Posts: 1000+

How Sine is messured

I understand how Sine is measured in math.

It is http://upload.wikimedia.org/math/4/e/5/4e587e4fdfd1d3179049169d6604d922.png

But what I want to know is how scratch determines  what the hypotenuse is , ect.

I can do it on paper but I am unable to figure out how it works in Scratch.


"Every challenge must be met, every battle must be won, and every story will end." -Me
Recycle49 December 09 - November 11 Goodbye

Offline

 

#2 2011-09-23 18:36:50

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: How Sine is messured

It's just like a calculator...

Offline

 

#3 2011-09-23 19:16:10

woofwoof301
Scratcher
Registered: 2008-06-01
Posts: 100+

Re: How Sine is messured

yeah. i know what you mean. Uh... consider this comment a bump. The guy above me has no idea what he is talking about. Sure, it is like a calculator, but no one cares, as calculators are not human. Smh. That doesn't help anything at all.

OH wait. Just got something.

Don't consider sine as opp/hyp. Consider it as, sine= y/r , where r is the radius of a circle. A lot of cool scratchers manipulate the sine function y/r so that only the r remains, and then can create many lines. The number you punch in is a ratio of the y and r. Typically, x and y don't exceed one. To get any greater value, you would multiply the sine by another number.

I'm kinda rusty on this, learning trig now.

Last edited by woofwoof301 (2011-09-23 19:16:55)

Offline

 

#4 2011-09-23 20:04:19

EdnaC
Scratcher
Registered: 2007-08-28
Posts: 100+

Re: How Sine is messured

recycle49 wrote:

I understand how Sine is measured in math.

It is http://upload.wikimedia.org/math/4/e/5/ … 04d922.png

But what I want to know is how scratch determines  what the hypotenuse is , ect.

I can do it on paper but I am unable to figure out how it works in Scratch.

Imagine that your sprite is traveling across the screen at some velocity (amount it moves in every time step) and some angle;  Sine and Cosine relate the (short) sides of a right triangle to the long side.  In the case of motion, the hypotenuse is known (the sprite's velocity);  Sin and Cos let you calculate how much each movement is in the "x" and "y" directions.   

Imagine a spaceship moving thru space - the direction that it moves doesn't depend on which way it's pointed.  Changes to how much it moves in each time step would  depend on the ship's "thrust".  The thrust has some strength and some direction, how much it changes the ship's velocity in X and Y would be found by using Sine and Cosine to find out the X and  Y "components" of the Thrust.  Happily, this isn't as complicated as it sounds...

Offline

 

#5 2011-09-23 20:42:01

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: How Sine is messured

Code:

Sin(x) = x - ((x^3)/3!) + ((x^5)/5!) - ((x^7)/7!) ... etc.

That should get you there.

Continue the sequence and you'll get more and more accurate.

Last edited by MoreGamesNow (2011-09-23 20:42:26)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#6 2011-09-23 21:58:29

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: How Sine is messured

woofwoof301 wrote:

yeah. i know what you mean. Uh... consider this comment a bump. The guy above me has no idea what he is talking about. Sure, it is like a calculator, but no one cares, as calculators are not human. Smh. That doesn't help anything at all.

OH wait. Just got something.

Don't consider sine as opp/hyp. Consider it as, sine= y/r , where r is the radius of a circle. A lot of cool scratchers manipulate the sine function y/r so that only the r remains, and then can create many lines. The number you punch in is a ratio of the y and r. Typically, x and y don't exceed one. To get any greater value, you would multiply the sine by another number.

I'm kinda rusty on this, learning trig now.

Hey woofwoof, please remember to be respectful. Putting down other members of the community is not okay.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#7 2011-09-24 01:14:20

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: How Sine is messured

woofwoof301 wrote:

yeah. i know what you mean. Uh... consider this comment a bump. The guy above me has no idea what he is talking about. Sure, it is like a calculator, but no one cares, as calculators are not human. Smh. That doesn't help anything at all.

OH wait. Just got something.

Don't consider sine as opp/hyp. Consider it as, sine= y/r , where r is the radius of a circle. A lot of cool scratchers manipulate the sine function y/r so that only the r remains, and then can create many lines. The number you punch in is a ratio of the y and r. Typically, x and y don't exceed one. To get any greater value, you would multiply the sine by another number.

I'm kinda rusty on this, learning trig now.

I know what I'm talking about.

Now stop insulting others.

Offline

 

#8 2011-09-24 10:41:54

cpumaster930
Scratcher
Registered: 2009-02-23
Posts: 100+

Re: How Sine is messured

recycle49 wrote:

I understand how Sine is measured in math.

It is http://upload.wikimedia.org/math/4/e/5/ … 04d922.png

But what I want to know is how scratch determines  what the hypotenuse is , ect.

I can do it on paper but I am unable to figure out how it works in Scratch.

The sine function you're referring to is the relationship between the sides of a right triangle and an angle.  However, the sine function can stand on its own without a right triangle--there's a specific value of sin x for each value of x.
For example:
sin 30 = 1/2
sin 45 = (radical 2)/2
sin 60 = (radical 3)/2

I know those because I had to memorize them last year  tongue
The 30, 45, and 60 are referring to an angle measure--the sine of any 30-degree angle will ALWAYS be 1/2.  No exceptions.

Correct me if I'm wrong, but Scratch probably uses the expanded factorial formula from MoreGamesNow's post to calculate the sine of an angle, right?  tongue

TL;DR: you don't need a triangle to find the sine of an angle.


http://i.imgur.com/Qd0lu.png

Offline

 

#9 2011-09-24 10:50:32

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Re: How Sine is messured

kayybee wrote:

woofwoof301 wrote:

yeah. i know what you mean. Uh... consider this comment a bump. The guy above me has no idea what he is talking about. Sure, it is like a calculator, but no one cares, as calculators are not human. Smh. That doesn't help anything at all.

OH wait. Just got something.

Don't consider sine as opp/hyp. Consider it as, sine= y/r , where r is the radius of a circle. A lot of cool scratchers manipulate the sine function y/r so that only the r remains, and then can create many lines. The number you punch in is a ratio of the y and r. Typically, x and y don't exceed one. To get any greater value, you would multiply the sine by another number.

I'm kinda rusty on this, learning trig now.

I know what I'm talking about.

Now stop insulting others.

+20

Sorry recycle, I do not know anything about trig.

Last edited by Thescratch3 (2011-09-24 10:50:52)


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#10 2011-09-24 12:09:56

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: How Sine is messured

Thescratch3 wrote:

kayybee wrote:

woofwoof301 wrote:

yeah. i know what you mean. Uh... consider this comment a bump. The guy above me has no idea what he is talking about. Sure, it is like a calculator, but no one cares, as calculators are not human. Smh. That doesn't help anything at all.

OH wait. Just got something.

Don't consider sine as opp/hyp. Consider it as, sine= y/r , where r is the radius of a circle. A lot of cool scratchers manipulate the sine function y/r so that only the r remains, and then can create many lines. The number you punch in is a ratio of the y and r. Typically, x and y don't exceed one. To get any greater value, you would multiply the sine by another number.

I'm kinda rusty on this, learning trig now.

I know what I'm talking about.

Now stop insulting others.

+20

Sorry recycle, I do not know anything about trig.

+infinity

Offline

 

#11 2011-09-24 13:30:34

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Re: How Sine is messured

ImagineIt wrote:

Thescratch3 wrote:

kayybee wrote:


I know what I'm talking about.

Now stop insulting others.

+20

Sorry recycle, I do not know anything about trig.

+infinity

big_smile


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#12 2011-09-25 17:47:02

recycle49
Scratcher
Registered: 2009-12-21
Posts: 1000+

Re: How Sine is messured

I see. I was a bit confused on how they were measured. These examples are great. I understand that now you have to consider a value as a measurement and calculate from there.


"Every challenge must be met, every battle must be won, and every story will end." -Me
Recycle49 December 09 - November 11 Goodbye

Offline

 

Board footer