velocity torus

About advanced scenes, and the Thyme scripting language used in Algodoo.

velocity torus

Postby sunnyshi2005 » Mon Jun 19, 2017 4:56 am

how can I create a velocity torus which accelerates the object collide with the torus inside exactly the same as the original velocity and rotate the angle to the angle of the tangent line to the contact point?
sunnyshi2005
 
Posts: 7
Joined: Wed Jun 14, 2017 3:33 am

Re: velocity torus

Postby Xray » Wed Jun 28, 2017 4:05 am

What is a velocity torus? :wtf:
User avatar
Xray
 
Posts: 500
Joined: Sun Jun 17, 2012 6:12 am
Location: USA

Re: velocity torus

Postby FRA32 » Fri Oct 27, 2017 7:30 pm

v = math.vec.len(vel);
ang = math.atan2(y,x)+-math.pi/2; (pick either + or - to determine the rotation direction)
vel = v*[math.cos(ang),math.sin(ang)]
FRA32
 
Posts: 229
Joined: Wed Dec 03, 2014 9:51 pm

Re: velocity torus

Postby Xray » Sat Oct 28, 2017 1:42 am

FRA32 - Could you please explain what that does in words so that math dummies like me could understand it? :lol:
User avatar
Xray
 
Posts: 500
Joined: Sun Jun 17, 2012 6:12 am
Location: USA

Re: velocity torus

Postby FRA32 » Tue Jun 05, 2018 6:51 pm

Oof so many necro answers, but this forums dead anyways.

My script would take the velocity and the position, determine the angle the position had to a point, and set the velocity perpendiicular to that, causing the object to orbit around a point. I didn't really understand their question so I just gave them that answer hoping it would fit xP
FRA32
 
Posts: 229
Joined: Wed Dec 03, 2014 9:51 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron