Tugboat M_file Arithmetic Version

# Tugboat M_file Arithmetic Version - TResRad = atan2...

This preview shows page 1. Sign up to view the full content.

Sheet1 Page 1 % Inputs T1F = input('Tug 1 Force (pounds): ') T1D = input('Tug 1 Direction (degrees): ') T2F = input('Tug 2 Force (pounds): ') T2D = input('Tug 2 Direction (degrees): ') T1x = T1F*cosd( T1D ) T1y = T1F*sind( T1D ) T2x = T2F*cosd( T2D ) T2y = T2F*sind( T2D ) TResx = T1x + T2x TResy = T1y + T2y TResF = sqrt( TResx^2 + TResy^2 )
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: TResRad = atan2( TResy,TResx ) TResD = TResRad*180/pi fprintf('\n') fprintf('\t\t\tForce\t\t\tDirection\n') fprintf('Tug 1\t\t%.0f\t\t\t %.0f\n',T1F,T1D) fprintf('Tug 2\t\t%.0f\t\t\t %.0f\n\n',T2F,T2D) fprintf('Total\t\t%.0f\t\t\t %.2f\n',TResF,TResD)...
View Full Document

## This note was uploaded on 09/26/2010 for the course CHE 210 taught by Professor Swinnea during the Fall '08 term at University of Texas.

Ask a homework question - tutors are online