Looking for equation/formula for calculating boomerang trajectory based on few variables for game

  • #1
ZeroX4
1
0
So basically i am vary green when it comes to equations/formula
Well to the point i don't even know if proper name for what i'm looking for is called equation or formula but let's stick to equation

So going as simple as i can
I want to throw boomerang creating boomerang like ellipse trajectory based on few variables
Kinda egg shape trajectory but being able to adjust it
Right now i am only able to make water drop like shape and either make it smaller or bigger but it scales proportionally
But that is because i am calculating trajectory based on distance of boomerang from player
And i know no other way to do it

Where i need to work in a way by me providing only few variables
Force - which applied to boomerang will push it in that direction in pixels/s
Angle - i am able to rotate trajectory of flight
So for example i can push boomerang 10 pixels per second in 90° angle yet i can offset it to -15° (i can put here any value)
Where i have two options
A - give boomerang values throw it and it will run on these values constantly without me being able to change them
B - constantly applying these 2 values where i am perfectly able to manipulate them at any given moment

Thing is i made power bar which charges on its own and when i throw boomerang at what % power was at the moment will be how strong throw will be
And based on that i calculate both Force and Angle values

My other problem is i can make perfect circles and water drop shapes of trajectory
But that is because i loop applied force by 360 so it goes from 0 to 360 then restarts from 0
Then i made equation to fly boomerang with that 180- that force
So it starts from 180 goes to 0 then starts going negative and goes down to -180 and after that it goes back to 180 and whole cycle loops again

I know no other way of doing it so i am stuck and that's why i came here to ask for help

And more or less i would be able to at least achieve two trajectory models
1714626040823.png


Either blue and red where they are evenly round on each side but squeezed either horizontally or vertically
Or green and purple
Where they are more rounded on one side but stretched on other
Kinda like balloon shape
Well if all 4 would be possible i would more than happy
I was on wiki i went into adventure with papu google
Yet all i find is how to calculate boomerang trajectory
And not how to make equation for a throw based on some values
And like i said i have 2 options
1 - i can throw it with static values which i cannot change when its flying
2 - i can throw it with dynamic values which i can constantly change
Where these values are force applied to boomerang in which it will move in pixels/s and angle of trajectory

I would wish to add option for my player ingame to gain power ups so he can throw boomerang faster but not in longer distance

So for example boomerang from moment of throw returns to player in 2 seconds instead of 3
But in both cases peak of distance between boomerang and player being some amount for example 100 (so i won't end up juicing it to the point it will fly most of the time off screen)

And that's why i would need equation to divide some value by other value so it scale proportionally

I am open for all ideas
 
Physics news on Phys.org
  • #2
Welcome to PF.
Sorry for the delay. Have you solved the problem?

Your description of the flight path deviates from that of real returning boomerangs, sufficiently to make your question difficult to answer. It is easier to think of, and analyse, the flight of a three or four bladed boomerang, than the traditional two bladed elbow, carved from a bent tree limb.

A boomerang is thrown or launched with a steep plane of rotation. The plane of rotation becomes more horizontal as it flies, until it returns to orbit the launcher in tight circles, before settling flat onto the ground.

The upper arm has greater velocity than the lower arm due to rotation. That greater lift force is towards increasing the steep plane of rotation, but gyroscopically it instead causes the boomerang to turn left, which is why it returns to the thrower.

The boomerang thrower controls four variables; azimuth and elevation direction, velocity and rate of rotation. The last two are related to the arm length of the boomerang, but their ratio can be adjusted by a flick of the wrist when releasing.

Azimuth is important, since a right-handed boomerang, will normally be thrown to the right of the oncoming wind. It will then curve to the left, before returning to the thrower from their left-hand side. Does your game manage wind direction, or should the boomerang be assumed ideal and dragless, to always return to the thrower.

The elevation of the throw is important since it decides the height above the ground on return to the thrower. For a 2D game, that can be ignored.
 
  • Informative
Likes Klystron and berkeman

Similar threads

Back
Top