Point Of intersection between two plotted functions

A

arslanburney

Is there anyway one could find ot the point of intersection between
any two plotted functions and also display them using gnuplot.py??
 
M

Mark Westwood

Hi

Let your 2 functions be f(x) and g(x). Then you have to solve the
equation f(x) = g(x).

For some functions it will be easier to determine intervals of the
real line where f(x)-g(x) > 0 and where f(x)-g(x) < 0 and to find an
interval in which the 2 intersect, which would probably be good enough
for plotting.

How straightforward any of this is depends entirely on the nature of
your functions.

Regards

Mark
 
T

Terry Reedy

| Is there anyway one could find ot the point of intersection between
| any two plotted functions

Assume you have sequence xi, yi, zi, where yi and zi are function values
corresponding to xi. In general, you will never have exact intersection
with yi==zi. So in addition, look for successive triples xi,yi,zi and
x(i+1), y(i+1), z(i+1) such that yi<zi and y(i+1)>z(i+1) or the other way
around. In other words, zi-yi and z(i+1)-y(i+1) have opposite signs. You
might want to also consider abs(zi-yi) < some very small number as possibly
indicating touching without crossing (as with tangents).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top