Is it possible to solve the following equation for the variable t, where t is both inside and outside of a trig function?

x = cos(a + w*t) + v*t

Printable View

- April 27th 2011, 11:45 AMcppProgrammerIsolate variable in trig equation
Is it possible to solve the following equation for the variable t, where t is both inside and outside of a trig function?

x = cos(a + w*t) + v*t - April 27th 2011, 12:08 PMAckbeet
Not possible analytically. You'd have to do it numerically. Do you have a specific x, a, w, and v in mind?

- April 27th 2011, 12:20 PMcppProgrammer
Okay. How about for the following values?

x = 1

a = 0.5*pi

w = pi

v = 2 - April 27th 2011, 12:25 PMAckbeet
- April 27th 2011, 02:50 PMtopsquark
- April 28th 2011, 07:02 AMcppProgrammer
I'm trying to figure out a precise and reliable way to determine when two convex polygons collide in 2d. With rotation and linear motion, things get complicated.

My thinking is to describe the motion of one of the polygons from the other's frame of reference and then check the path of each of its points against each of the stationary object's edges.

The equation's more complicated than what i wrote but i thought i'd start at the simplest scenario, with only one polygon in rotation and linear motion, and work my way up.

here's a better description of the equation i posted:

x = cos(a + w*t) + v*t, where

a is the starting orientation of point about the center of its orbit,

w is the point's angular velocity,

v is the x component of the point of rotation's linear velocity, and

t is time

I was hoping, since the path of the point in the xt and yt planes is well defined, i might be able to find the values of t for which x is a specific value and then check the value of y at t. I'm a bit out of my depth though, trying to solve the equation.

It seems this isn't possible. I appreciate the help though. - April 28th 2011, 07:10 AMtopsquark
Not for general values of the variables, but if you have specific values numerical methods are always an option. One possibility is the Newton-Raphson method. There may be better ones for your specific form of equation, but this one has the advantage of simplicity.

An interesting problem. Good luck with it.

-Dan - April 28th 2011, 11:56 AMcppProgrammer
The Newton method seems very well suited to this problem. I'm looking forward to implementing it. Thanks for the input.