## Find the intersection point between 2 curves

### Antonio Sepe (view profile)

on 6 May 2019
Latest activity Commented on by Antonio Sepe

### Antonio Sepe (view profile)

on 7 May 2019
Hi there!
I'm a new matlab user so I don't know all its features.
I'm having trouble in finding the intersection point between two curves (I_moon and Moon_ref). Can you help me?
This is my code:
%------------------------------------------------------------------------%
%------------------------------------------------------------------------%
%------------------------------------------------------------------------%
%------------------------------------------------------------------------%
%Target: Moon;
%Atmosphere and surface: no atmosphere;
%Surface temperature: 130 K;
%Albedo: 0.136;
%Wavelength range: 0-50 μm;
%Data from: nasa.gov
clear all;
close all;
clear global;
clc
%--------------------------------Costants--------------------------------%
c=2.998*10^8; % speed of light in vacuum
h=6.6261*10.^-34; % Planck constant
k=1.38*10.^-23; % Boltzmann constant
sigma=5.67*(10^-8); %Stephen-Boltzmann constant
L=(0.0:0.01:50); %wavelength (μm)
T=130; %Moon average temperature (K)
d=1; %Sun-Moon distance (AU)
T_sun=5777; %Sun average temperature (K)
Fs=1366; %Solar constant at 1 AU (W/m^2)
I_sun=3.742./((L.^5).*(exp(1.439e4./(L.*5777))-1));
I_moon=3.742./((L.^5).*(exp(1.439e4./(L.*130))-1));
Moon_ref=albedo*((r^2)/(1^2))*I_sun;
%------------------------------Absorptance-------------------------------%
F=Fs*(1./(d.^2)); %Solar constants for Moon=1366 (W/(m^2))
ToT_moon=Moon_ref+(Abs*I_moon);
figure4 = figure;
axes1 = axes('Parent',figure4);
hold(axes1,'on');
xlabel({'wavelength (μm)'});
title({'Moon','(130K)'});
xlim(axes1,[1 20]);
ylim(axes1,[1e-30 1]);
set(axes1,'YMinorTick','on','YScale','log');
plot(L,I_moon,'Color',[0 0 1]);
hold on
plot(L,Moon_ref,'Color',[1 0 0]);
plot(L,ToT_moon,'Color',[0 0 0]);
hold off;
legend({'Emitted','Reflected','Total'},'Location','southeast');

### Stephan (view profile)

on 6 May 2019

create a function handle depending from wave length, that subtracts both from each other. this is the objective function for using fzero function. As result you get the interception wave length.

Antonio Sepe

### Antonio Sepe (view profile)

on 7 May 2019
I tried to use fzero funcion but it didn't work.
I solved the problem by using polyxpoly, in this way (consider data in my question):
[xint,yint] = polyxpoly(L,I_moon,L,Moon_ref);
figure4 = figure;
axes1 = axes('Parent',figure4);
hold(axes1,'on');
xlabel({'wavelength (μm)'});
title({'Moon','(130K)'});
xlim(axes1,[1 20]);
ylim(axes1,[1e-30 1]);
set(axes1,'YMinorTick','on','YScale','log');
plot(L,I_moon,'Color',[0 0 1]);
hold on
plot(L,Moon_ref,'Color',[1 0 0]);
plot(L,ToT_moon,'Color',[0 0 0]);
mapshow(xint,yint,'Displaytype','point','Marker','o');
legend({'Emitted','Reflected','Total','λ equiv.'},'Location','southeast');
hold off
Thx anyway :)