• Create Account

We're offering banner ads on our site from just \$5!

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1Xeno  Members   -  Reputation: 122

Like
Likes
Like

Posted 17 August 2001 - 08:48 AM

ok , im trying to create path finding to my game. now , to make my units avoid obstacle , i have to rotate them (actually rotate the image) , now , lets say my unit velocity on X is 2 pixels per frame and on the Y is 3 pixels per frame , now , lets say my unit is moving in a circle movement , how can i know my rotation radius? i dont know the frequency of the unit''s circle movement and i dont know the time that takes for the unit to complete one cycle. what should i do then? how can i know the rotation radius? Thanks a lot!

"Thats who you are. Thats what you could." ------------------------------ - Goblineye Entertainment ------------------------------

### #2Dragonus  Members   -  Reputation: 122

Like
Likes
Like

Posted 17 August 2001 - 09:23 AM

I think you don't have enough information to find that out...

Since you have no linear acceleration (I'm assuming you have a constant linear velocity of radical 13), you know one variable, namely v . And you want to know the radius of the circle, r .

So what equations can we come up with?

Using rotational kinematics, we know that r * omega = v , where omega is the rotational velocity (radians/second).

There's also d = v * t , d = r * theta , and theta = omega * t , where d is linear distance, t is time, and theta is the angle on the circle to the point.

So how many variables do we have? r, omega, v, d, t, theta . 6 variables; 4 equations. Knowing your initial velocity reduces your variables by one: 5 vars in 4 eqs. Since you don't know any other variables (or do you?), the best you can get is an infinite number of answers.

And really, that makes sense. If you're in a car going 40mph, you can make a really slow turn around a bend, and you can make a pretty quick turn. Granted, there is a limiting point as to how small a turn you can make at that speed , but you don't just have one -- it depends more on how much you turn the steering wheel .

If you do know another of the other unknown variables you didn't mention (linear distance or angular position on the circle), then just use the 4 equations above to solve them all...

~ Dragonus
If F = ma, and Work = Fd, does that mean that Work = mad?

Edited by - Dragonus on August 17, 2001 4:25:49 PM

### #3Xeno  Members   -  Reputation: 122

Like
Likes
Like

Posted 17 August 2001 - 10:23 PM

Wait , i think i do know the angle , well , if the angle is what i think , which is the actual of the object (after i rotated it) , hen i know the angle.

"Thats who you are. Thats what you could."
------------------------------
- Goblineye Entertainment
------------------------------

### #4Dragonus  Members   -  Reputation: 122

Like
Likes
Like

Posted 20 August 2001 - 03:02 AM

  .-----. / / \| / || -----|| | \ / °-----°

Pardon the horrendous ASCII art.

The angle you need is the angle shown above. Given that an object is going along a circular path, it''s the number of radians it has travelled along the circular path. So (as shown in the picture above) if we start off on the right side of the circular path and are heading counterclockwise, our "angle" is the angle shown above.

Dragonus
Thought of the Moment
If F = ma, and Work = Fd, then does Work = mad?

### #5Xeno  Members   -  Reputation: 122

Like
Likes
Like

Posted 20 August 2001 - 09:45 AM

pardon the pixel graphics!

well , actually i can get this angle with some analitic geometry tricks

as u can see in this pic , i can get the green line formula easily , and then i can find the center of the circle with just puting 0 in the green line fomula ( y = mx + n ) , then i can find the vector which points from the center of the circle to the object which moving along the circle , after that , i just perform a DotProduct between the v(1,0) vector , and the vector that points to the object. and thats it , i got the angle...
then , anyway , how can i get the rotation radius then ?

"Thats who you are. Thats what you could."
------------------------------
- Goblineye Entertainment
------------------------------

### #6Xeno  Members   -  Reputation: 122

Like
Likes
Like

Posted 20 August 2001 - 09:49 AM

errr.... the pic cannot be accessed from a remote site , can i send it to u in mail?

### #7Dragonus  Members   -  Reputation: 122

Like
Likes
Like

Posted 20 August 2001 - 10:29 AM

Right-click the bad image and click Properties. Copy the URL in the window that pops up into your browser to see it. ^_^

Dragonus
Thought of the Moment
"Everything, no matter how unlikely, has a very small yet finite chance of happening." ~Heisenburg''s Uncertainty Principle
That still gives me hope that, one day, I''ll be teleported to some remote desert isle surrounded by women who think I''m a god.

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS