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

#1 2010-06-21 10:11:10

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Trigonometry Help

I'm making a game that uses a decent amount of trig. What I'm trying to do now is calculate what degree of a circle the mouse is at. Here is a diagram:

Code:

------------------------------------------------------------------
------------------------------------------------------------------
------------<|- (mouse) -------------------------------------
------------------------------------------------------------------
---------------------------___----------------------------------
-------------------------/ c  \--------------------------------
------------------------|      |--------------------------------
-------------------------\_____/--------------------------------
------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------------------------

So, if a line were drawn here (roughly):

Code:

                                                                  
                                                                  
            <|- (mouse)                                      
                \                                                  
                  \        ___                                  
                    \    / c  \                                
                      \ |      |                                
                         \_____/

At what angle of the circle would the line be?

Offline

 

#2 2010-06-21 10:25:48

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Trigonometry Help

Can you upload the project so that I can have a better view at the script.
I FEEL THAT YOU CAN ONLY USE THE TRIAL AND ERROR METHOD.
(Make a sprite move around the circle and then see if its the tangent.Set the direction to it if its the tangent.)


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#3 2010-06-21 10:42:52

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: Trigonometry Help

The project is still under construction, and I don't think it makes a difference. I'm pretty sure there is SOME way to do it with an algorithim. And just so you know, the size of the circle changes, so that could be important too...

Offline

 

#4 2010-06-21 10:49:35

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Trigonometry Help

UPLOAD THE INCOMPLETE PROJECT.I'm sure I would be better able to help you that way.


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#5 2010-06-21 11:14:39

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: Trigonometry Help

I'm telling you it doesn't matter. All I need is a formula and I'll be all set! What could you possibly want to know about the project?

Offline

 

#6 2010-06-21 11:20:28

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Trigonometry Help

I cant think of any formula fitting into it.I can only see projects and then Improve on it. So unless I see it I cant help you.I'm sorry.

I dont want to know anything about the projects.I'M NO STALKER/COPIER.I'm just a critic.
Unless I see the project, I cant help you


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#7 2010-06-21 11:30:03

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Trigonometry Help

I recently studied trigonometry, and I'm thinking...

You're going to want to use cosine of mouse x times 360.

I think.  tongue


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#8 2010-06-21 12:08:46

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Trigonometry Help

FINALLY, I'VE DONE IT.

*APPLAUSE AND CHEERS*  big_smile   tongue   wink

http://scratch.mit.edu/projects/Subh2/1140664

MY NAME IS SUBH AND I'M NOT A STALKER


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#9 2010-06-21 12:27:55

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: Trigonometry Help

Subh wrote:

FINALLY, I'VE DONE IT.

*APPLAUSE AND CHEERS*  big_smile   tongue   wink

http://scratch.mit.edu/projects/Subh2/1140664

MY NAME IS SUBH AND I'M NOT A STALKER

It's close... Very close... The only thing is Greatdane's is closer. Thanks for your help anyway.

EDIT: Nevermind. Greatdane's doesn't work at all. YOUR THE NEW CHAMPION!  tongue

Last edited by shadow_7283 (2010-06-21 12:30:45)

Offline

 

#10 2010-06-21 12:29:18

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: Trigonometry Help

Greatdane wrote:

I recently studied trigonometry, and I'm thinking...

You're going to want to use cosine of mouse x times 360.

I think.  tongue

The only problem with that is it doesn't use Scratch's system of directions (stupid negative degrees). *Sigh*

EDIT: Nevermind. It doesn't work. (But the above is still true).

Last edited by shadow_7283 (2010-06-21 12:31:14)

Offline

 

#11 2010-06-21 12:30:58

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Trigonometry Help

Greatdane only posted some idea (which I did not get). Yet you are saying that He is closer.

C'MON THANK ME.... I MADE A PROJECT

EDIT: I AM THE CHAMPION

Last edited by Subh (2010-06-21 12:31:43)


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#12 2010-06-21 12:31:54

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: Trigonometry Help

Subh wrote:

Greatdane only posted some idea (which I did not get). Yet you are saying that He is closer.

C'MON THANK ME.... I MADE A PROJECT

SEE MY EDITS! GREATDANE WAS WRONG! YOU ARE THE CHAMPION!
Still... there HAS to be a formula for it...

Offline

 

#13 2010-06-21 12:33:32

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Trigonometry Help

I Saw It And Edited It.
Btw, I Used A Formula (it First Finds The Tangent And Then Finds The Direction)


EDIT: ITS MY 100TH POST.................................
*LOUDEST APPLAUSE*
I AM THE CHAMPION

Last edited by Subh (2010-06-21 12:34:36)


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#14 2010-06-21 12:35:04

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Trigonometry Help

shadow_7283 wrote:

Subh wrote:

Greatdane only posted some idea (which I did not get). Yet you are saying that He is closer.

C'MON THANK ME.... I MADE A PROJECT

SEE MY EDITS! GREATDANE WAS WRONG! YOU ARE THE CHAMPION!
Still... there HAS to be a formula for it...

I am technically closer, and Subh doesn't get my idea, but in all technicality, it works.  big_smile

If Scratch doesn't work, there couldn't be a formula. I'll try to do something else.


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#15 2010-06-21 12:36:17

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Trigonometry Help

Greatdane wrote:

shadow_7283 wrote:

Subh wrote:

Greatdane only posted some idea (which I did not get). Yet you are saying that He is closer.

C'MON THANK ME.... I MADE A PROJECT

SEE MY EDITS! GREATDANE WAS WRONG! YOU ARE THE CHAMPION!
Still... there HAS to be a formula for it...

I am technically closer, and Subh doesn't get my idea, but in all technicality, it works.  big_smile

If Scratch doesn't work, there couldn't be a formula. I'll try to do something else.

CAN YOU EXPLAIN YOUR IDEA/GIVE FORMULA?

I THINK THAT I IMPLEMENTED THE SAME IDEA AS YOURS

I SEE WE ARE ALL ONLINE !!!!

Last edited by Subh (2010-06-21 12:37:15)


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#16 2010-06-21 12:37:32

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: Trigonometry Help

Greatdane wrote:

shadow_7283 wrote:

Subh wrote:

Greatdane only posted some idea (which I did not get). Yet you are saying that He is closer.

C'MON THANK ME.... I MADE A PROJECT

SEE MY EDITS! GREATDANE WAS WRONG! YOU ARE THE CHAMPION!
Still... there HAS to be a formula for it...

I am technically closer, and Subh doesn't get my idea, but in all technicality, it works.  big_smile

If Scratch doesn't work, there couldn't be a formula. I'll try to do something else.

No. The problem is that it is only based on x. What about poor y?

Offline

 

#17 2010-06-21 12:38:43

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Trigonometry Help

Can Any1 Explain Whts The Idea?


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#18 2010-06-21 12:40:51

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: Trigonometry Help

Subh wrote:

Can Any1 Explain Whts The Idea?

What do you mean?

By the way, after further testing...

Yours doesn't work either.  tongue

Offline

 

#19 2010-06-21 12:41:47

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Trigonometry Help

LEAVE A COMMENT ON THIS ACCOUNT(NOT SUBH2) IF YOU WANT TO CONTACT ME LATER.
BYE

mods I think the problem is solved. Can you plz close the topic?


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#20 2010-06-21 12:42:20

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Trigonometry Help

I'm sure this will work the best:

http://i.imgur.com/GuPRt.gif

Try it.


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#21 2010-06-21 12:43:04

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Trigonometry Help

shadow_7283 wrote:

Subh wrote:

Can Any1 Explain Whts The Idea?

What do you mean?

By the way, after further testing...

Yours doesn't work either.  tongue

What was GreatDane's IDEA?

What is the problem in my method?
Comment on my project.


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#22 2010-06-21 12:44:09

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: Trigonometry Help

Greatdane wrote:

I'm sure this will work the best:

http://i.imgur.com/GuPRt.gif

Try it.

It doesn't! What about poor y?

Offline

 

#23 2010-06-21 12:45:52

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Trigonometry Help

Why is my method wrong?What was Greatdane's Idea?


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#24 2010-06-21 12:46:33

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Trigonometry Help

shadow_7283 wrote:

Greatdane wrote:

I'm sure this will work the best:

http://i.imgur.com/GuPRt.gif

Try it.

It doesn't! What about poor y?

The thing is, how large is your circle?


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#25 2010-06-21 12:47:31

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Trigonometry Help

Greatdane wrote:

shadow_7283 wrote:

Greatdane wrote:

I'm sure this will work the best:

http://i.imgur.com/GuPRt.gif

Try it.

It doesn't! What about poor y?

The thing is, how large is your circle?

Depends on radius(i used radius variable)


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

Board footer