Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have an issue with following problem:

A line needs to be intersected with a cosinus function.

My line would be

$\displaystyle l_1 = \binom{x_1}{y_1} + s\binom{u_1}{v_1}$

My function for a curved line in 2D is

$\displaystyle g: y_2 = d + a + a * (-cos(f * x_2))$

I need the first intersection (the smallest s > 0). How do I do that? I stand at

$s * v_1 + a * cos(f * (x_1 + s * u_1)) = y_1 - a - d$

and have no idea how to solve for s from here.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Your expression is of the form $s+A\cos(b+c\ s) = d$. Generally, you can't give an expression for the solution - it can only be done numerically.

By a linear transformation, this can be written as $p x+q\cos(x) = r$. When mathematicians noticed that they often needed to solve $x e^x = y$ for $x$, they invented a function (the Lambert W function) that solved it. Similarly, you could create a function (the Roth C function) that solves $\cos(x)/x = y$ for $x$ and give the solution to your equation in terms of $C$.

Until such a function exists, you will have to be content with solving the equation numerically.

share|improve this answer
    
Er, okay, I will refrain from trying to invent something, and instead do it numerically :) –  SinisterMJ Jul 18 '13 at 14:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.