# Finding equation for trigonometric function based on two points

#### diffusion

Is there any standard way to do this? Specifically, I know the equation I'm looking for is a cosine function, and I know two points. Is there a way to find the equation of the cos function which has been translated and compressed given only these two points?

#### jdougherty

Unfortunately there's not a unique cosine function given only two points. A general cosine function is something like A*cos(Bx+C)+D, where all of the capital letters are degrees of freedom. You need at least one point for each degree of freedom to have a unique function.

If you want to restrict the function to only compression and translation you could consider a function of the form A*cos(x+B), in which case you could determine a unique one. If the two points are (x,y) and (w,z), then you have to solve the system of equations:

A*cos(x+B) = y ==> A = y*sec (x+B)
and
A*cos(w+B) = z ==> B = arccos(z/A) + w

"Finding equation for trigonometric function based on two points"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving