Problem 61165. Breaking straight lines

Let P be a point in Oxy plane and let p be a 1×2 array representing an one-degree or zero-degree polynomials, if its first entry is a non-zero constant or a zero constant, respectively.
Break the given line by building a piecewise linear function constituted by two branches:
  • one branch stands for the parent polynomial p;
  • and another branch stands for the perpendicular line, r, to p that passes by the point P (see figure below).
Given (P, p), find
  • R, the breaking point;
  • r, the 1×2 array that represents the perpendicular line. If r violates the definition of a function, return r = ''.
input: (P, p)
output: (R, r)
Break line

Solution Stats

83.33% Correct | 16.67% Incorrect
Last Solution submitted on Jan 27, 2026

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers4

Suggested Problems

More from this Author17

Community Treasure Hunt

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

Start Hunting!