Question: USE MATLAB, FUNCTIONS ON MATLAB Specifications for your function are as follows: The input arguments to your function are the slope and intercept of the
USE MATLAB, FUNCTIONS ON MATLAB
Specifications for your function are as follows:
The input arguments to your function are the slope and intercept of the line and the x and y coordinates of the point.
The output argument for your function is the distance from the point to the line.
To determine the distance, your function will need to perform the following steps:
Determine the slope for the perpendicular line, which is the negative reciprocal of the slope for your original line.
Determine the y-intercept of the perpendicular line
Solve the matrix equation for determining the point of intersection between the two lines
Determine the distance between your original point and the point of intersection
A. Distance from a Point to a Line In this part of the lab, you will write a function that will determine the distance from a point to a line. This can be done by finding the line that is perpendicular to your original line which passes through the point of interest. Once you have the line, you can determine the point of intersection between the two lines and ultimately the distance from the point of interest to the point on the line Specifications for your function are as follows The input arguments to your function are the slope and intercept of the line and the x and y coordinates of the point. The output argument for your function is the distance from the point to the line To determine the distance, your function will need to perform the following steps: 1. Determine the slope for the perpendicular line, which is the negative reciprocal of the slope for your original line 2. Determine the y-intercept of the perpendicular line 3. Solve the matrix equation for determining the point of intersection between the two lines 4. Determine the distance between your original point and the point of intersection The diagram below depicts the process you will be implementing. 0.8 09Intersection of original and 7 perpendicular lines 0.5 0.4 0.3 Distance 0.2 Point 0 0.1 0.203 04 05 0.6 07 0.8 091 Figure 1: Line-Point Distance Once you have your function working, determine the distances for the following line-point pairs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
