mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Added matlab code samples.
All of these code samples currently are mis-identified in my repositories. I'm donating them to the cause.
This commit is contained in:
		
							
								
								
									
										13
									
								
								samples/Matlab/distance.m
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								samples/Matlab/distance.m
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
function [ value,isterminal,direction ] = distance( t,y,mu )
 | 
			
		||||
% DISTANCE compute the distance from the attactors
 | 
			
		||||
%   [ value,terminal,direction ] = distance( t,y )
 | 
			
		||||
 | 
			
		||||
d=1e-2; % FIXME
 | 
			
		||||
 | 
			
		||||
% TODO mettere if se tolleranza D-d<tol -> value=0
 | 
			
		||||
D=sqrt((y(1)+mu).^2+y(2).^2); % distance from the largest primary
 | 
			
		||||
 | 
			
		||||
value=d-D;
 | 
			
		||||
isterminal=1;
 | 
			
		||||
direction=0;
 | 
			
		||||
end
 | 
			
		||||
		Reference in New Issue
	
	Block a user