You are on page 1of 4

CS10-8: Computer Programming

FA1.1

Name: ALEXCES M. TOLENTINO Score:

Section: C3 Date: 06/17/2022

INSTRUCTION:

This assessment requires peer review. Two reviews are needed per student.

Provide an example problem in Sciences or Mathematics that can be solved easily by MATLAB.
For comparison, include the following.

• Manual solutions - use texts and equation editor for your submission. You may add
photos/screenshots that are related to the problem.

• MATLAB solutions (the longer way) - use script

• MATLAB solutions (the shorter way) using built-in functions - use script

Use Attachment for inserting MATLAB screenshots, script files (M-files), and necessary
photos/screenshots related to the problem.

PROBLEM STATEMENT:

You are given two sides of a triangle, a = 9 and b = 13. The angle between them is 37 degrees.
Write a script to find the length of the third side and the area of the triangle. Hint: use trigonometric
CS10-8: Computer Programming
FA1.1

Manual Solution:

For Length of Side C

𝐺𝐼𝑉𝐸𝑁:
𝑎 = 9 , 𝑏 = 13 , 𝜃 = 37°

𝐹𝑂𝑅𝑀𝑈𝐿𝐴:
𝑐 = √𝑎2 + 𝑏2 − 2(𝑎)(𝑏)(cos 𝜃)

𝑆𝑂𝐿𝑈𝑇𝐼𝑂𝑁:
𝑐 = √92 + 132 − 2(9)(13)(cos(37°))
= √81 + 169 − 234 cos(37°)
= √250 − 234 cos(37°)
= 7.94476

𝐹𝑂𝑅 𝐴𝑅𝐸𝐴 𝑂𝐹 𝑇𝑅𝐼𝐴𝑁𝐺𝐿𝐸

𝐺𝐼𝑉𝐸𝑁:
𝑎 = 9 , 𝑏 = 13 , 𝜃 = 37°

𝐹𝑂𝑅𝑀𝑈𝐿𝐴:
1
𝐴𝑟𝑒𝑎 = 2 (𝑎)(𝑏)(𝑠𝑖𝑛𝜃)

𝑆𝑂𝐿𝑈𝑇𝐼𝑂𝑁:
1
𝐴𝑟𝑒𝑎 = (9)(13)(sin(37))
2
1
= (9)(13)(sin(37))
2
117(sin(37))
=
2
= 35.20618
CS10-8: Computer Programming
FA1.1

In the command window, take a screenshot and paste your output:


CS10-8: Computer Programming
FA1.1

You might also like