Compute the sum of distances from a point to the sides of an equilateral triangle - MATLAB Cody - MATLAB Central

Problem 59501. Compute the sum of distances from a point to the sides of an equilateral triangle

Difficulty:Rate
Write a function to compute the sum of the (shortest) distances from a point inside an equilateral triangle to the sides of the triangle. That is, for the triangle below, compute the sum a+b+c. Input will consist of the point (x0,y0) and vectors x and y with the coordinates of the vertices of the triangle.
equilateral triangle with distances from a point

Solution Stats

100.0% Correct | 0.0% Incorrect
Last Solution submitted on May 04, 2024

Solution Comments

Show comments
Join Cody Contest 2025 — Have Fun and Win Prizes!
...
We’re excited to invite you to Cody Contest 2025! 🎉 Pick a team,...

Problem Recent Solvers6

Suggested Problems

More from this Author314

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!