Browse Search Popular Register Upload Rules User list Login:
Search:
atan2 mouse control(motor)

Image:
screenshot of the scene

Author: standardtoaster

Group: Default

Filesize: 78.59 kB

Date added: 2009-10-12

Rating: 5.6

Downloads: 994

Views: 2045

Comments: 4

Ratings: 2

Times favored: 0

Made with: Algodoo before v1.8.5

Tags:

Scene tag

atan2 formula:
Scene.my.atan2=(P1, P2)=>{2 * math.atan((P2(1)-P1(1)) / (((((P2(0)-P1(0))^2) + (P2(1)-P1(1))^2) ^ 0.5) + (P2(0)-P1(0))))}

rad2deg formula:
Scene.my.rad2deg=(n)=>{n < 0 ? {(((math.toFloat(n) * math.toFloat(180)) / math.pi) + 360)} : {((math.toFloat(n) * math.toFloat(180)) / math.pi)}}

Updated!
Last edited at 2009/10/13 01:40:21 by standardtoaster
Please log in to rate this scene
edit
Similar scenes
Title: Mouse Controlled Minigun
Rating: 6.4
Filesize: 20.49 kB
Downloads: 1149
Comments: 9
Ratings: 4
Date added: 2010/12/21 20:21:27
Made with: Phun
Rating: rated 6.4
download
Title: Pong With AI, Mouse Control and Score
Rating: 6.8182
Filesize: 11.31 kB
Downloads: 1246
Comments: 6
Ratings: 5
Date added: 2009/07/08 07:52:49
Made with: Phun
Rating: rated 6.8
download
Title: Apache with Mouse Controlled Canon
Rating: 6.3636
Filesize: 282.61 kB
Downloads: 2020
Comments: 9
Ratings: 5
Date added: 2010/12/22 10:23:30
Made with: Phun
Rating: rated 6.4
download
Title: SkiSim (mouse control)
Rating: 5.125
Filesize: 254.63 kB
Downloads: 849
Comments: 1
Ratings: 2
Date added: 2009/06/25 21:43:23
Made with: Phun
Rating: rated 5.1
download
Title: Stable Flying Robot(G-Force idea mouse control)
Rating: 5
Filesize: 14.97 kB
Downloads: 523
Comments: 0
Ratings: 1
Date added: 2012/10/11 23:57:41
Made with: Algodoo v2.0.1
Rating: rated 5
download
Title: The BETTER mouse trap (V. 2)
Rating: 6.1
Filesize: 60.18 kB
Downloads: 746
Comments: 3
Ratings: 10
Date added: 2008/06/05 17:13:45
Made with: Phun
Rating: rated 6.1
download
If you want to let the pointer follow full 360° without suddenly spinning into the other direction you have to add a littlebit to your code.
Thanks! I know that I have to edit the code a bit. I'm going to try and work it out later today. If I need help with it I'll send you a message. ;D
Alright :*)
I have fixed and updated the scene. You can now feed it two points and it will calculate the angle between those points in radians.