Browse Search Popular Register Upload Rules User list Login:
Search:
Spring with self adjusting length

Image:
screenshot of the scene

Author: KarateBrot

Group: Default

Filesize: 300 kB

Date added: 2009-07-29

Rating: 5.6

Downloads: 878

Views: 1098

Comments: 0

Ratings: 2

Times favored: 0

Made with: Phun

Tags:

Scene tag

It's a spring that adjusts its length referring to the distance between the two orange boxes. It's a test for the targeting system of my FGM-148 Javelin v1.0. I want to use scripts to steer the rocket into it's target in top-attack mode and I need the distance between target, rocket, and launcher. I don't know if this phunlet could be useful. If you want to use it you're free to do so.

Variables:
scene.my.x1
scene.my.y1
scene.my.x2
s-
cene.my.y2
scene.my.xRel
scene.my.yRel


If you delete the floor and fixate one box the spring slowly extends.

If you drag a box slowly the spring extends referring to the distance. The other box only starts to move if you drag fast enough.


- - - - - - - - - - - - - - -


Calculation method:

1)
detecting all coordinates
(x1, y1, x2, y2)

2)
calculating the absolute value of the difference between x and y coordinates (relative coordinates) (they also could be negative but with absolute values it looks nicer :bonk:)
∆x = |x2 - x1| and ∆y = |y2 - y1|

3)
Pythagoras' theorem for calculating the length (L)
L = √(∆x² + ∆y²)
Last edited at 2009/08/05 01:04:56 by KarateBrot
Please log in to rate this scene
edit
Similar scenes
Title: Zero Length Spring Linkage
Rating: 5.375
Filesize: 57.96 kB
Downloads: 375
Comments: 1
Ratings: 2
Date added: 2015/02/05 09:40:28
Made with: Algodoo v2.1.0
Rating: rated 5.4
download
Title: Zero Length Spring Swing II
Rating: 5.625
Filesize: 72.56 kB
Downloads: 1212
Comments: 5
Ratings: 2
Date added: 2015/11/17 23:13:13
Made with: Algodoo v2.1.0
Rating: rated 5.6
download
Title: Cat or dog polygones made of springs
Rating: 5
Filesize: 34.67 kB
Downloads: 407
Comments: 1
Ratings: 1
Date added: 2010/06/22 13:30:56
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Title: PolyBuild Physics Game (1.2)
Rating: 6.1111
Filesize: 81.33 kB
Downloads: 1743
Comments: 2
Ratings: 3
Date added: 2022/01/07 02:41:14
Made with: Algodoo v2.1.0
Rating: rated 6.1
download
Title: Zero-Length Spring
Rating: 5.625
Filesize: 13.67 kB
Downloads: 567
Comments: 4
Ratings: 2
Date added: 2014/06/14 23:19:18
Made with: Algodoo v2.1.0
Rating: rated 5.6
download
Title: Zero Length Spring Swing
Rating: 5
Filesize: 100.48 kB
Downloads: 660
Comments: 2
Ratings: 1
Date added: 2015/11/17 00:08:33
Made with: Algodoo v2.1.0
Rating: rated 5
download