This preview shows pages 1–3. Sign up to view the full content.
%Engineering 6, Spring 2006, Problem 3.1 Solution
%(Circles and triangles)
%Turn off extra line breaks in display
format
compact
;
%Clear command window and variables
clc;
clear;
%We know the length of sides C1C2 and C1C4, so if we can find the
%angle between them (call it theta), then we can use the law of cosines to
%find the length C2C4, which is what is asked for.
%We know all three sides of triangles C1C2C3 and C1C3C4. We can
%therefore use the law of cosines to calculate the angle phi1 between
%sides C1C2 and C1C3, and the angle phi2 between sides C1C3 and
%C1C4. Then phi1 + phi2 is the angle theta.
%Define the radii values (in mm)
R1 = 16;
R2 = 6.5;
R3 = 12;
R4 = 9.5;
%Calculate the lengths of the various sides needed
sideC1C2 = R1 + R2;
sideC1C3 = R1 + R3;
sideC1C4 = R1 + R4;
sideC2C3 = R2 + R3;
sideC3C4 = R3 + R4;
%Use law of cosines to calculate phi1 and phi2
phi1 = acos((sideC1C2^2 + sideC1C3^2  sideC2C3^2)/(2*sideC1C2*sideC1C3));
phi2 = acos((sideC1C3^2 + sideC1C4^2  sideC3C4^2)/(2*sideC1C3*sideC1C4));
%Calculate theta
theta = phi1 + phi2;
%Use law of cosines to calculate length of side C2C4
sideC2C4 = sqrt(sideC1C2^2 + sideC1C4^2  2*sideC1C2*sideC1C4*cos(theta));
%Display result
fprintf(
'The distance between the centers C2 and C4 is %.2f mm\n'
,sideC2C4);
Displayed results:
The distance between the centers C2 and C4 is 33.51 mm
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document %Engineering 6, Spring 2006, Problem 3.2 Solution
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 01/22/2011 for the course ENG 006 taught by Professor Lagerstrom during the Spring '06 term at UC Davis.
 Spring '06
 Lagerstrom

Click to edit the document details