Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Given a triangle with sides L1, L2, L3 , its area is calculated via the formula Area = sqrt(p * (p - L1) *
1. Given a triangle with sides L1, L2, L3, its area is calculated via the formula Area = sqrt(p * (p - L1) * (p - L2) * (p - L3)), where p = (L1 + L2 + L3) / 2. Write an R function called tri_area that outputs the area of a triangle given its sides, and calculate the area of a triangle with sides L1 = 3, L2 = 4, L3 = 5.
2. in R, we use square brackets [ ] to refer to specific elements of a vector. How would you look up the third element of vector v?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started