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

Views: 2178

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: atan2 mouse control(springs)
Rating: 5.1111
Filesize: 77.08 kB
Downloads: 1163
Comments: 1
Ratings: 3
Date added: 2009/10/12 18:37:07
Made with: Algodoo before v1.8.5
Rating: rated 5.1
download
Title: Pong With AI, Mouse Control and Score
Rating: 6.8182
Filesize: 11.31 kB
Downloads: 1393
Comments: 6
Ratings: 5
Date added: 2009/07/08 07:52:49
Made with: Phun
Rating: rated 6.8
download
Title: SkiSim (mouse control)
Rating: 5.125
Filesize: 254.63 kB
Downloads: 951
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: 623
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: 545
Comments: 0
Ratings: 2
Date added: 2009/09/27 16:48:32
Made with: Algodoo demo
Rating: rated 5.6
download
Title: Mouse controlled crane V2
Rating: 6
Filesize: 32.85 kB
Downloads: 1336
Comments: 3
Ratings: 3
Date added: 2011/01/30 18:04:37
Made with: Algodoo before v1.8.5
Rating: rated 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.