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: 677

Views: 1754

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: 908
Comments: 9
Ratings: 4
Date added: 2010/12/21 20:21:27
Made with: Phun
Rating: rated 6.4
download
Title: Mouse Controlled Car for tutorial
Rating: 6.1111
Filesize: 59.25 kB
Downloads: 1129
Comments: 3
Ratings: 3
Date added: 2009/09/26 04:25:19
Made with: Algodoo before v1.8.5
Rating: rated 6.1
download
Title: Forklift(mouse controlled)
Rating: 9.3344
Filesize: 10.29 kB
Downloads: 49536
Comments: 36
Ratings: 94
Date added: 2009/03/24 04:11:48
Made with: Phun
Rating: rated 9.3
download
Title: Apache with Mouse Controlled Canon
Rating: 6.3636
Filesize: 282.61 kB
Downloads: 1737
Comments: 9
Ratings: 5
Date added: 2010/12/22 10:23:30
Made with: Phun
Rating: rated 6.4
download
Title: Stable Flying Robot(G-Force idea mouse control)
Rating: 5
Filesize: 14.97 kB
Downloads: 388
Comments: 0
Ratings: 1
Date added: 2012/10/11 23:57:41
Made with: Algodoo v2.0.1
Rating: rated 5
download
Title: Mouse control, using springs.
Rating: 5.625
Filesize: 24.15 kB
Downloads: 385
Comments: 0
Ratings: 2
Date added: 2009/09/27 16:48:32
Made with: Algodoo demo
Rating: rated 5.6
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.