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:
------------------------------------------------------------------ ------------------------------------------------------------------ ------------<|- (mouse) ------------------------------------- ------------------------------------------------------------------ ---------------------------___---------------------------------- -------------------------/ c \-------------------------------- ------------------------| |-------------------------------- -------------------------\_____/-------------------------------- ------------------------------------------------------------------ ------------------------------------------------------------------ ------------------------------------------------------------------
So, if a line were drawn here (roughly):
<|- (mouse)
\
\ ___
\ / c \
\ | |
\_____/At what angle of the circle would the line be?
Offline
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.)
Offline
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
UPLOAD THE INCOMPLETE PROJECT.I'm sure I would be better able to help you that way.
Offline
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
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
Offline
FINALLY, I'VE DONE IT.
*APPLAUSE AND CHEERS*
http://scratch.mit.edu/projects/Subh2/1140664
MY NAME IS SUBH AND I'M NOT A STALKER
Offline
Subh wrote:
FINALLY, I'VE DONE IT.
*APPLAUSE AND CHEERS*![]()
![]()
![]()
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!
Last edited by shadow_7283 (2010-06-21 12:30:45)
Offline
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.![]()
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
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)
Offline
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
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)
Offline
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 PROJECTSEE 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.
If Scratch doesn't work, there couldn't be a formula. I'll try to do something else.
Offline
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 PROJECTSEE 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.
![]()
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)
Offline
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 PROJECTSEE 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.
![]()
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
Offline
Subh wrote:
Can Any1 Explain Whts The Idea?
What do you mean?
By the way, after further testing...
Yours doesn't work either.
Offline
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?
Offline
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.![]()
What was GreatDane's IDEA?
What is the problem in my method?
Comment on my project.
Offline
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
Why is my method wrong?What was Greatdane's Idea?
Offline
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?
Offline
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)
Offline