Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » X and Y Velocities to Angular Velocity
- Astora
-
24 posts
X and Y Velocities to Angular Velocity
In my pendulum project on my test account, https://scratch.mit.edu/projects/276462111, I have used trigonometry to convert angular velocities to indivdiual x and y velocities. However, I need to convert them again back to angular velocities.
I found this formula here: https://scicomp.stackexchange.com/questions/11353/angular-velocity-by-vector-2d ,
ω=rxvy−ryvx/r2x+r2y (can't copy and paste correctly), where ‘ω is the angular velocity, r is the vector from the center of rotation to the point under consideration, and v is the velocity vector’. By ‘r is the vector from the center of rotation to the point under consideration’ just mean the radius? If not, what does it mean and does anyone know another way to convert 2 values, that being an x and y velocity to a single angular velocity?
I found this formula here: https://scicomp.stackexchange.com/questions/11353/angular-velocity-by-vector-2d ,
ω=rxvy−ryvx/r2x+r2y (can't copy and paste correctly), where ‘ω is the angular velocity, r is the vector from the center of rotation to the point under consideration, and v is the velocity vector’. By ‘r is the vector from the center of rotation to the point under consideration’ just mean the radius? If not, what does it mean and does anyone know another way to convert 2 values, that being an x and y velocity to a single angular velocity?
- game_pr0grammer
-
500+ posts
X and Y Velocities to Angular Velocity
{does} “r is the vector from the center of rotation to the point under consideration” just mean the radius?
yup
also, maybe you could get the magnitude of the velocity like this
idk lol
- Astora2
-
8 posts
X and Y Velocities to Angular Velocity
{does} “r is the vector from the center of rotation to the point under consideration” just mean the radius?yup
also, maybe you could get the magnitude of the velocity like thisidk lol
the get magnitude block doesn't make sense? x-x would always equal 0, as would y-y?
- HowToLogic
-
34 posts
X and Y Velocities to Angular Velocity
https://scratch.mit.edu/projects/276462111, I have used trigonometry to convert angular velocities to indivdiual x and y velocities. However, I need to convert them again back to angular velocities.In my pendulum project on my test account,
I found this formula here: https://scicomp.stackexchange.com/questions/11353/angular-velocity-by-vector-2d ,
ω=rxvy−ryvx/r2x+r2y (can't copy and paste correctly), where ‘ω is the angular velocity, r is the vector from the center of rotation to the point under consideration, and v is the velocity vector’. By ‘r is the vector from the center of rotation to the point under consideration’ just mean the radius? If not, what does it mean and does anyone know another way to convert 2 values, that being an x and y velocity to a single angular velocity?
Well to get the angle of the velocity you can use:
(atan(x/y))+(180*(y<0))
To get the magnitude:
sqrt(x*x+y*y)
And to convert from angular to x and y.
x = magnitude*sin(angle)
y = magnitude*cos(angle)
Hope this helps

- Locomule
-
1000+ posts
X and Y Velocities to Angular Velocity
this Cosine method also makes a great jump when you don't need gravity like for a simple runner as it always returns to the same ground level, no collision detection needed
https://scratch.mit.edu/projects/13055322/
https://scratch.mit.edu/projects/13055322/
Last edited by Locomule (Jan. 11, 2019 14:53:58)
- Discussion Forums
- » Help with Scripts
-
» X and Y Velocities to Angular Velocity